|
| 1 | +properties([ |
| 2 | + parameters([ |
| 3 | + booleanParam(name: 'Reset', defaultValue: false, description: 'clean workspace files'), |
| 4 | + booleanParam(name: 'Clobber', defaultValue: false, description: 'run mach clobber'), |
| 5 | + booleanParam(name: 'Linux64', defaultValue: true, description: ''), |
| 6 | + booleanParam(name: 'Windows64', defaultValue: true, description: ''), |
| 7 | + booleanParam(name: 'MacOSX64', defaultValue: true, description: ''), |
| 8 | + string(name: 'ReleaseName', defaultValue: '', description: ''), |
| 9 | + ]), |
| 10 | +]) |
| 11 | + |
| 12 | +def buildmatrix = [:] |
| 13 | +def signmatrix = [:] |
| 14 | +def shouldRelease = params.ReleaseName?.trim() |
| 15 | +def helpers |
| 16 | + |
| 17 | +node('master') { |
| 18 | + checkout scm |
| 19 | + |
| 20 | + helpers = load "release/build-helpers.groovy" |
| 21 | +} |
| 22 | + |
| 23 | +if (params.Linux64) { |
| 24 | + def name = 'Linux64' |
| 25 | + def artifactGlob = 'obj-x86_64-pc-linux-gnu/dist/Ghostery-*' |
| 26 | + |
| 27 | + buildmatrix[name] = { |
| 28 | + node('docker && !magrathea') { |
| 29 | + helpers.build(name, 'Linux.dockerfile', 'linux.mozconfig', 'obj-x86_64-pc-linux-gnu/dist/Ghostery-*', params)() |
| 30 | + stage("${name}: publish artifacts") { |
| 31 | + archiveArtifacts artifacts: "mozilla-release/${artifactGlob}" |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +if (params.Windows64) { |
| 38 | + def name = 'Windows64' |
| 39 | + def artifactGlob = 'obj-x86_64-pc-mingw32/dist/install/**/*' |
| 40 | + |
| 41 | + buildmatrix[name] = { |
| 42 | + // we have to run windows builds on magrathea because that is where the vssdk mount is. |
| 43 | + node('docker && magrathea') { |
| 44 | + helpers.build(name, 'Windows.dockerfile', 'win64.mozconfig', artifactGlob, params)() |
| 45 | + stage("${name}: publish artifacts") { |
| 46 | + archiveArtifacts artifacts: "mozilla-release/${artifactGlob}" |
| 47 | + stash name: name, includes: "mozilla-release/${artifactGlob},mozilla-release/browser/config/version.txt,mozilla-release/other-licenses/7zstub/firefox/*,mozilla-release/browser/installer/windows/*" |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + |
| 52 | + if (shouldRelease) { |
| 53 | + signmatrix["Sign ${name}"] = helpers.windows_signing(name, artifactGlob) |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +if (params.MacOSX64) { |
| 58 | + def name = 'MacOSX64' |
| 59 | + def artifactGlob = 'obj-x86_64-apple-darwin/dist/Ghostery-*' |
| 60 | + buildmatrix[name] = { |
| 61 | + node('docker && !magrathea') { |
| 62 | + helpers.build(name, 'MacOSX.dockerfile', 'macosx.mozconfig', 'obj-x86_64-apple-darwin/dist/Ghostery-*', params)() |
| 63 | + stage("${name}: publish artifacts") { |
| 64 | + archiveArtifacts artifacts: "mozilla-release/${artifactGlob}" |
| 65 | + // files needed for packaging |
| 66 | + stash includes: "mozilla-release/${artifactGlob},mozilla-release/build/package/mac_osx/unpack-diskimage,mozilla-release/security/mac/hardenedruntime/*", name: name |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + if (shouldRelease) { |
| 72 | + signmatrix["Sign MacOSX64"] = helpers.mac_signing(name, artifactGlob) |
| 73 | + } |
| 74 | +} |
| 75 | + |
| 76 | +parallel buildmatrix |
| 77 | +parallel signmatrix |
| 78 | + |
| 79 | +stage('release') { |
| 80 | + if (shouldRelease) { |
| 81 | + helpers.withGithubRelease() { |
| 82 | + sh 'rm -rf artifacts' |
| 83 | + |
| 84 | + unarchive mapping: ["mozilla-release/" : "artifacts"] |
| 85 | + |
| 86 | + def artifacts = sh(returnStdout: true, script: 'find artifacts -type f').trim().split("\\r?\\n") |
| 87 | + |
| 88 | + for(String artifactPath in artifacts) { |
| 89 | + def artifactName = artifactPath.split('/').last() |
| 90 | + sh """ |
| 91 | + github-release upload \ |
| 92 | + --user human-web \ |
| 93 | + --repo user-agent-desktop \ |
| 94 | + --tag "${params.ReleaseName}" \ |
| 95 | + --name "${artifactName}" \ |
| 96 | + --file "${artifactPath}" |
| 97 | + """ |
| 98 | + } |
| 99 | + |
| 100 | + sh 'rm -rf artifacts' |
| 101 | + } |
| 102 | + } |
| 103 | +} |
0 commit comments