99# Should any of these axioms change, the release pipeline will need to be (significantly) refactored.
1010# 0.8.x releases existed before this pipeline; they are done differently, similarities are coincidental.
1111
12- name : Release
12+ name : Release Community 1.x to Maven Central
1313on :
1414 workflow_dispatch :
1515 inputs :
2121 default : 1.x
2222 required : true
2323 dryRun :
24- description : ' Do a dry run? (true or false) '
24+ description : ' Do a dry run?'
2525 default : true
2626 required : true
27+ type : boolean
2728jobs :
2829 build :
2930 env :
@@ -32,10 +33,23 @@ jobs:
3233 runs-on : self-hosted
3334 permissions :
3435 contents : write # IMPORTANT: required for action to create release branch
35- pull-requests : write # IMPORTANT: so release PR can be created
3636 id-token : write # IMPORTANT: mandatory for trusted publishing
3737 attestations : write # IMPORTANT: mandatory for attestations
3838 steps :
39+ - name : Print inputs to the release workflow
40+ run : echo "${{ toJSON(github.event.inputs) }}"
41+
42+ - name : Validate the version
43+ shell : bash
44+ env :
45+ VERSION : ${{ github.event.inputs.version }}
46+ run : |
47+ version="$VERSION"
48+ if [[ "$version" != 1.* ]]; then
49+ echo "The version input '$version' is invalid. This workflow only supports versions starting with '1.'."
50+ exit 1
51+ fi
52+
3953 - name : Checkout timefold-solver
4054 uses : actions/checkout@v6
4155 with :
6276 # Technically, this goes against the main reason for doing a dry run; to eliminate potential problems.
6377 # But unless something catastrophic happened, PR checks on source branch already ensured that all tests pass.
6478 - name : Set release version and build release
79+ env :
80+ NEW_VERSION : ${{ inputs.version }}
81+ DRY_RUN : ${{ inputs.dryRun }}
6582 run : |
66- ./mvnw -Dfull versions:set -DnewVersion=${{ github.event.inputs.version }}
67- ./mvnw -Dfull deploy -DskipTests=${{ github.event.inputs.dryRun }} -DaltDeploymentRepository=local::default::file://`pwd`/target/staging-deploy
83+ ./mvnw -Dfull versions:set -DnewVersion="$NEW_VERSION" -DgenerateBackupPoms=false
84+ ./mvnw -Dfull deploy -DskipTests=$DRY_RUN -DaltDeploymentRepository=local::default::file://`pwd`/target/staging-deploy
6885 cp docs/target/antora.yml docs/src/antora.yml
6986 git add docs/src/antora.yml
7087 find . -name 'pom.xml' | xargs git add
0 commit comments