diff --git a/custom-jobs/krita/Krita_Release_Appimage_Build.pipeline b/custom-jobs/krita/Krita_Release_Appimage_Build.pipeline index 47c24d9..26ac228 100644 --- a/custom-jobs/krita/Krita_Release_Appimage_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Appimage_Build.pipeline @@ -1,111 +1,116 @@ // Ask for parameters we will need later on def buildParameters = input( message: 'Which version of Krita is being built?', ok: 'Begin Build', parameters: [ choice(choices: "stable\nunstable\n", description: '', name: 'Release'), string(defaultValue: '', description: '', name: 'Version', trim: true) ] ) +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters.Version ?: '' + // Request a node to be allocated to us node( "Appimage1604" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First Thing: Checkout Sources stage('Checkout Sources') { // Make sure we have a clean slate to begin with deleteDir() // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else sh """ - wget "https://origin.files.kde.org/krita/.release/${buildParameters['Version']}/krita-${buildParameters['Version']}.tar.gz" + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" - tar -xf "$WORKSPACE/krita-${buildParameters['Version']}.tar.gz" + tar -xf "$WORKSPACE/krita-${buildVersion}.tar.gz" - mv krita-${buildParameters['Version']} krita + mv krita-${buildVersion} krita """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round copyArtifacts filter: 'krita-appimage-deps.tar, gmic_krita_qt-x86_64.appimage', projectName: 'Krita_Nightly_Appimage_Dependency_Build' // Now we unpack them sh """ mkdir -p $HOME/appimage-workspace/ cd $HOME/appimage-workspace/ tar -xf $WORKSPACE/krita-appimage-deps.tar """ } // Let's build Krita that we have everything we need stage('Building Krita') { // The first parameter to the script is where the scripts should work - which is our workspace in this case // Otherwise we leave everything in the hands of that script sh """ export PATH=$HOME/tools/bin/:$PATH krita/packaging/linux/appimage/build-krita.sh $HOME/appimage-workspace/ $WORKSPACE/krita/ """ } // Now we can generate the actual Appimages! stage('Generating Krita Appimage') { // The scripts handle everything here, so just run them sh """ export PATH=$HOME/tools/bin/:$PATH krita/packaging/linux/appimage/build-image.sh $HOME/appimage-workspace/ $WORKSPACE/krita/ mv $HOME/appimage-workspace/*.appimage $WORKSPACE/ """ // Capture the generated appimages for relocation to the signer stash includes: '*.appimage', name: 'appimages' } } } } // Now we transition over to the privileged signer // Request a node to be allocated to us node( "AppimageSigner" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // Generate the appimage update stage('Signing Appimage') { // Make sure we have a clean slate to begin with deleteDir() // We'll need the Binary Factory tooling for this.... checkout changelog: true, poll: true, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'binary-factory-tooling/']], userRemoteConfigs: [[url: 'https://invent.kde.org/sysadmin/binary-factory-tooling.git']] ] // Restore the previously captured appimages unstash 'appimages' // Call the script to perform the signing, then generate the deltas sh """ APPIMAGE_PATH="\$(echo krita-*.appimage)" binary-factory-tooling/appimages/sign-appimage.sh \$APPIMAGE_PATH zsyncmake -u "\${BUILD_URL}/artifact/\$(basename \${APPIMAGE_PATH})" -o \$APPIMAGE_PATH.zsync \$APPIMAGE_PATH mv \$APPIMAGE_PATH.zsync Krita-CHANGEME-x86_64.appimage.zsync """ // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.appimage, *.appimage.zsync', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Release_MacOS_Build.pipeline b/custom-jobs/krita/Krita_Release_MacOS_Build.pipeline index aa64013..3514c68 100644 --- a/custom-jobs/krita/Krita_Release_MacOS_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_MacOS_Build.pipeline @@ -1,82 +1,87 @@ // Ask for parameters we will need later on def buildParameters = input( message: 'Which version of Krita is being built?', ok: 'Begin Build', parameters: [ string(defaultValue: '', description: '', name: 'Version', trim: true) ] ) +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters.Version ?: '' + // Request a node to be allocated to us node( "macOS" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First Thing: Checkout Sources stage('Checkout Sources') { // Make sure we have a clean slate to begin with deleteDir() // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else bat """ - wget "https://origin.files.kde.org/krita/.release/${buildParameters['Version']}/krita-${buildParameters['Version']}.tar.gz" + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" - tar -xf "\$WORKSPACE/krita-${buildParameters['Version']}.tar.gz" + tar -xf "\$WORKSPACE/krita-${buildVersion}.tar.gz" - mv krita-${buildParameters['Version']} krita + mv krita-${buildVersion} krita """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round copyArtifacts filter: 'krita-macos-deps.tar', projectName: 'Krita_Nightly_MacOS_Dependency_Build' // Now we unpack them // We also make sure our build workspace is ready at the same time sh """ export BUILDROOT=\$HOME/KritaBuild/ [[ -d \$BUILDROOT ]] || mkdir \$BUILDROOT [[ -s \$BUILDROOT/krita ]] || ln -s \$WORKSPACE/krita \$BUILDROOT/krita cd \$BUILDROOT tar -xf $WORKSPACE/krita-macos-deps.tar """ } // Let's build Krita now that we have everything we need stage('Building Krita') { // The first parameter to the script is what it should be doing - which is building and installing Krita // The workspace it uses was setup in the previous step sh """ export PATH=\$HOME/Craft/Krita/macos-64-clang/bin/:\$HOME/Craft/Krita/macos-64-clang/dev-utils/bin/:\$PATH export BUILDROOT=\$HOME/KritaBuild/ bash krita/packaging/macos/osxbuild.sh buildinstall """ } // Now we can generate the actual DMG! stage('Generating Krita DMG') { // The scripts handle everything here, so just run them sh """ export PATH=\$HOME/Craft/Krita/macos-64-clang/bin/:\$HOME/Craft/Krita/macos-64-clang/dev-utils/bin/:\$PATH export BUILDROOT=\$HOME/KritaBuild/ bash krita/packaging/macos/osxdeploy.sh -s="K Desktop Environment e.V. (5433B4KXM8)" -notarize-ac="apple-store@kde.org" -asc-provider="5433B4KXM8" mv \$BUILDROOT/*.dmg \$WORKSPACE/ """ } // Finally we capture the DMG for distribution to users stage('Capturing DMGs') { // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.dmg', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Release_Windows32_Build.pipeline b/custom-jobs/krita/Krita_Release_Windows32_Build.pipeline index 021887a..c0597b8 100644 --- a/custom-jobs/krita/Krita_Release_Windows32_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Windows32_Build.pipeline @@ -1,109 +1,114 @@ // Ask for parameters we will need later on def buildParameters = input( message: 'Which version of Krita is being built?', ok: 'Begin Build', parameters: [ string(defaultValue: '', description: '', name: 'Version', trim: true) ] ) +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters.Version ?: '' + // Request a node to be allocated to us node( "WindowsMingw" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First Thing: Checkout Sources stage('Checkout Sources') { // Make sure we have a clean slate to begin with deleteDir() // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else bat """ set PATH=C:/MingW/i686-7.3.0-posix-dwarf-rt_v5-rev0/mingw32/bin;C:/PROGRA~2/Python38-32/;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% set CA_CERT_BUNDLE=C:/Craft/Krita/windows-msvc2019_64-cl/etc/cacert.pem - wget --ca-certificate %CA_CERT_BUNDLE% "https://origin.files.kde.org/krita/.release/${buildParameters['Version']}/krita-${buildParameters['Version']}.tar.gz" + wget --ca-certificate %CA_CERT_BUNDLE% "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" - 7za x "%WORKSPACE%/krita-${buildParameters['Version']}.tar.gz" - 7za x "%WORKSPACE%/krita-${buildParameters['Version']}.tar" + 7za x "%WORKSPACE%/krita-${buildVersion}.tar.gz" + 7za x "%WORKSPACE%/krita-${buildVersion}.tar" - ren krita-${buildParameters['Version']} krita + ren krita-${buildVersion} krita """ } // Now retrieve the dependency artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round copyArtifacts filter: 'krita-deps.zip', projectName: 'Krita_Release_Windows32_Dependency_Build' // Now we unpack them bat """ mkdir C:\\Packaging\\KritaWS\\ cd C:\\Packaging\\KritaWS\\ C:\\Craft\\Krita\\windows-msvc2019_64-cl\\dev-utils\\bin\\7za.exe x "%WORKSPACE%\\krita-deps.zip" """ } // Now we can build Krita stage('Building Krita') { // Before we can do this we need to setup some environment variables to help guide the Krita scripts around // In particular it needs: // PATH set to guide it to CMake and to allow it to find Mingw (Git and Python are already in PATH as standard convention for these builders) // SEVENZIP_EXE set to guide it to 7-Zip's console utility. It's detection support doesn't work as our binary is named 7za.exe instead of the apparently standard 7z.exe // Then we can run it // We also set SIGNTOOL_SIGN_FLAGS which is used by the package signing script when invoking signtool.exe bat """ set PATH=C:/MingW/i686-7.3.0-posix-dwarf-rt_v5-rev0/mingw32/bin;C:/PROGRA~2/Python38-32/;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% set SEVENZIP_EXE=C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/7za.exe set GETTEXT_SEARCH_PATH=C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/PROGRA~2/Python38-32/ cmd /c krita\\build-tools\\windows\\build.cmd --no-interactive --skip-deps --src-dir "%WORKSPACE%\\krita" --download-dir "%WORKSPACE%\\downloads" --krita-build-dir "%WORKSPACE%\\build" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" if errorlevel 1 exit /b %errorlevel% set SIGNTOOL_SIGN_FLAGS=/v /n "K Desktop Environment e.V." /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 - cmd /c krita\\packaging\\windows\\package-complete.cmd --no-interactive --src-dir "%WORKSPACE%\\krita" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" --pre-zip-hook "%WORKSPACE%\\krita\\packaging\\windows\\sign-package.cmd" --package-name "krita-x86-${buildParameters['Version']}" + cmd /c krita\\packaging\\windows\\package-complete.cmd --no-interactive --src-dir "%WORKSPACE%\\krita" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" --pre-zip-hook "%WORKSPACE%\\krita\\packaging\\windows\\sign-package.cmd" --package-name "krita-x86-${buildVersion}" if errorlevel 1 exit /b %errorlevel% """ } stage('Generating Installer') { // Let's build an installer! bat """ set PATH=C:/MingW/i686-7.3.0-posix-dwarf-rt_v5-rev0/mingw32/bin;C:/PROGRA~2/Python38-32/;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% - set PACKAGE_NAME=krita-x86-${buildParameters['Version']} + set PACKAGE_NAME=krita-x86-${buildVersion} cd C:\\Packaging\\KritaWS mkdir installer cd installer cmake -DREMOVE_DEBUG=ON -DOUTPUT_FILEPATH="%WORKSPACE%\\%PACKAGE_NAME%-setup.exe" -DKRITA_PACKAGE_ROOT="%WORKSPACE%\\%PACKAGE_NAME%" -P "C:\\Packaging\\KritaWS\\krita-install\\MakeinstallerNsis.cmake" if errorlevel 1 exit /b 1 call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvars64.bat" set SIGNTOOL_SIGN_FLAGS=/v /n "K Desktop Environment e.V." /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 signtool sign %SIGNTOOL_SIGN_FLAGS% "%WORKSPACE%\\%PACKAGE_NAME%-setup.exe" """ } // Now we capture them for use stage('Capturing Build') { // To do this we just ask Jenkins to capture the zip file as an artifact archiveArtifacts artifacts: 'krita-x86-*.zip, krita-x86-*-setup.exe', onlyIfSuccessful: true } } // As the Windows Slaves are permanent ones, we erase the Workspace as the last thing we do deleteDir() // Same goes for the stable workspace that we use bat """ rmdir /s /q C:\\Packaging\\KritaWS\\ """ } } diff --git a/custom-jobs/krita/Krita_Release_Windows64_Build.pipeline b/custom-jobs/krita/Krita_Release_Windows64_Build.pipeline index a636923..d8a057b 100644 --- a/custom-jobs/krita/Krita_Release_Windows64_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Windows64_Build.pipeline @@ -1,108 +1,113 @@ // Ask for parameters we will need later on def buildParameters = input( message: 'Which version of Krita is being built?', ok: 'Begin Build', parameters: [ string(defaultValue: '', description: '', name: 'Version', trim: true) ] ) +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters.Version ?: '' + // Request a node to be allocated to us node( "WindowsMingw" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First Thing: Checkout Sources stage('Checkout Sources') { // Make sure we have a clean slate to begin with deleteDir() // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else bat """ set PATH=C:/MingW/x86_64-7.3.0-posix-seh-rt_v5-rev0/mingw64/bin;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% set CA_CERT_BUNDLE=C:/Craft/Krita/windows-msvc2019_64-cl/etc/cacert.pem - wget --ca-certificate %CA_CERT_BUNDLE% "https://origin.files.kde.org/krita/.release/${buildParameters['Version']}/krita-${buildParameters['Version']}.tar.gz" + wget --ca-certificate %CA_CERT_BUNDLE% "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" - 7za x "%WORKSPACE%/krita-${buildParameters['Version']}.tar.gz" - 7za x "%WORKSPACE%/krita-${buildParameters['Version']}.tar" + 7za x "%WORKSPACE%/krita-${buildVersion}.tar.gz" + 7za x "%WORKSPACE%/krita-${buildVersion}.tar" - ren krita-${buildParameters['Version']} krita + ren krita-${buildVersion} krita """ } // Now retrieve the dependency artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round copyArtifacts filter: 'krita-deps.zip', projectName: 'Krita_Nightly_Windows_Dependency_Build' // Now we unpack them bat """ mkdir C:\\Packaging\\KritaWS\\ cd C:\\Packaging\\KritaWS\\ C:\\Craft\\Krita\\windows-msvc2019_64-cl\\dev-utils\\bin\\7za.exe x "%WORKSPACE%\\krita-deps.zip" """ } // Now we can build Krita stage('Building Krita') { // Before we can do this we need to setup some environment variables to help guide the Krita scripts around // In particular it needs: // PATH set to guide it to CMake and to allow it to find Mingw (Git and Python are already in PATH as standard convention for these builders) // SEVENZIP_EXE set to guide it to 7-Zip's console utility. It's detection support doesn't work as our binary is named 7za.exe instead of the apparently standard 7z.exe // Then we can run it // We also set SIGNTOOL_SIGN_FLAGS which is used by the package signing script when invoking signtool.exe bat """ set PATH=C:/MingW/x86_64-7.3.0-posix-seh-rt_v5-rev0/mingw64/bin;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% set SEVENZIP_EXE=C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/7za.exe set GETTEXT_SEARCH_PATH=C:\\Craft\\Krita\\windows-msvc2019_64-cl\\bin cmd /c krita\\build-tools\\windows\\build.cmd --no-interactive --skip-deps --src-dir "%WORKSPACE%\\krita" --download-dir "%WORKSPACE%\\downloads" --krita-build-dir "%WORKSPACE%\\build" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" if errorlevel 1 exit /b %errorlevel% set SIGNTOOL_SIGN_FLAGS=/v /n "K Desktop Environment e.V." /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 - cmd /c krita\\packaging\\windows\\package-complete.cmd --no-interactive --src-dir "%WORKSPACE%\\krita" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" --pre-zip-hook "%WORKSPACE%\\krita\\packaging\\windows\\sign-package.cmd" --package-name "krita-x64-${buildParameters['Version']}" + cmd /c krita\\packaging\\windows\\package-complete.cmd --no-interactive --src-dir "%WORKSPACE%\\krita" --deps-install-dir "C:\\Packaging\\KritaWS\\deps-install" --krita-install-dir "C:\\Packaging\\KritaWS\\krita-install" --pre-zip-hook "%WORKSPACE%\\krita\\packaging\\windows\\sign-package.cmd" --package-name "krita-x64-${buildVersion}" if errorlevel 1 exit /b %errorlevel% """ } stage('Generating Installer') { // Let's build an installer! bat """ set PATH=C:/MingW/x86_64-7.3.0-posix-seh-rt_v5-rev0/mingw64/bin;C:/Craft/Krita/windows-msvc2019_64-cl/bin/;C:/Craft/Krita/windows-msvc2019_64-cl/dev-utils/bin/;%PATH% - set PACKAGE_NAME=krita-x64-${buildParameters['Version']} + set PACKAGE_NAME=krita-x64-${buildVersion} cd C:\\Packaging\\KritaWS mkdir installer cd installer cmake -DREMOVE_DEBUG=ON -DOUTPUT_FILEPATH="%WORKSPACE%\\%PACKAGE_NAME%-setup.exe" -DKRITA_PACKAGE_ROOT="%WORKSPACE%\\%PACKAGE_NAME%" -P "C:\\Packaging\\KritaWS\\krita-install\\MakeinstallerNsis.cmake" if errorlevel 1 exit /b 1 call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build/vcvars64.bat" set SIGNTOOL_SIGN_FLAGS=/v /n "K Desktop Environment e.V." /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 signtool sign %SIGNTOOL_SIGN_FLAGS% "%WORKSPACE%\\%PACKAGE_NAME%-setup.exe" """ } // Now we capture them for use stage('Capturing Build') { // To do this we just ask Jenkins to capture the zip file as an artifact archiveArtifacts artifacts: 'krita-x64-*.zip, krita-x64-*-setup.exe', onlyIfSuccessful: true } } // As the Windows Slaves are permanent ones, we erase the Workspace as the last thing we do deleteDir() // Same goes for the stable workspace that we use bat """ rmdir /s /q C:\\Packaging\\KritaWS\\ """ } }