| 1 |
/* Copyright (C) 2025 Wildfire Games. |
| 2 |
* This file is part of 0 A.D. |
| 3 |
* |
| 4 |
* 0 A.D. is free software: you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation, either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* 0 A.D. is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
*/ |
| 17 |
|
| 18 |
// This pipeline is used to generate patch releases. |
| 19 |
// It starts by generating a patch file in a dedicated workspace, then it triggers a downstream job |
| 20 |
// which is an instance of the bundles pipeline, passing the patch file to it. |
| 21 |
|
| 22 |
pipeline { |
| 23 |
agent { |
| 24 |
node { |
| 25 |
label 'WindowsAgent' |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
parameters { |
| 30 |
string(name: 'BUNDLE_VERSION', description: 'Bundle Version') |
| 31 |
string(name: 'NIGHTLY_REVISION', description: 'Revision of the nightly build corresponding to the release') |
| 32 |
string(name: 'RELEASE_TAG', description: 'Git tag from which the point release originates') |
| 33 |
} |
| 34 |
|
| 35 |
stages { |
| 36 |
stage('Generate Patch') { |
| 37 |
steps { |
| 38 |
checkout scmGit(branches: [[name: "${GIT_BRANCH}"]], extensions: [cleanAfterCheckout(), localBranch()]) |
| 39 |
bat 'cd build\\build_version && build_version.bat' |
| 40 |
archiveArtifacts artifacts: 'build/build_version/build_version.txt' |
| 41 |
bat "git diff ${RELEASE_TAG}..HEAD > ${BUNDLE_VERSION}.patch" |
| 42 |
archiveArtifacts artifacts: "${params.BUNDLE_VERSION}.patch" |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
stage('Bundle Patched Release') { |
| 47 |
steps { |
| 48 |
build job: '0ad-patch-bundles', wait: false, waitForStart: true, parameters: [ |
| 49 |
string(name: 'BUNDLE_VERSION', value: "${params.BUNDLE_VERSION}"), |
| 50 |
string(name: 'NIGHTLY_REVISION', value: "${params.NIGHTLY_REVISION}"), |
| 51 |
booleanParam(name: 'PATCH_BUILD', value: true) |
| 52 |
] |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
} |