Timefold Solver 1.16.0 #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Finish Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
env: | |
RELEASE_BRANCH_NAME: "__timefold_release_branch__" | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
steps: | |
- name: Checkout timefold-solver | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 # Otherwise merge will fail on account of not having history. | |
- name: Put back the 999-SNAPSHOT version on the release branch | |
run: | | |
git config user.name "Timefold Release Bot" | |
git config user.email "release@timefold.ai" | |
git checkout $RELEASE_BRANCH_NAME | |
mvn -Dfull versions:set -DnewVersion=999-SNAPSHOT | |
sed -i "s/^timefold_solver_python_version.*=.*/timefold_solver_python_version = '999-dev0'/" setup.py | |
git commit -am "build: move back to 999-SNAPSHOT" | |
git push origin $RELEASE_BRANCH_NAME | |
- name: Update release branch | |
shell: bash | |
run: | | |
tag=${{ github.ref }} | |
tag_version=${tag##*/} | |
version=${tag_version%.*} | |
version="${version:1}.x" | |
echo $version | |
exists="$(git branch -a | grep -w $version || true)" | |
echo "branch $exists" | |
if [ -n "$exists" ]; then | |
git config user.name "Timefold Release Bot" | |
git config user.email "release@timefold.ai" | |
git checkout $RELEASE_BRANCH_NAME | |
git checkout $version | |
git merge -Xtheirs --no-edit --squash -m "build: release version $tag_version" $RELEASE_BRANCH_NAME | |
git push origin $version | |
git push -d origin $RELEASE_BRANCH_NAME | |
else | |
git checkout $RELEASE_BRANCH_NAME | |
git branch -m $RELEASE_BRANCH_NAME $version | |
git push origin -u $version | |
git push -d origin $RELEASE_BRANCH_NAME | |
fi |