-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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: Update release branch | ||
shell: bash | ||
run: | | ||
tag=${{ github.ref }} | ||
tag_version=${tag##*/} | ||
version=${tag_version%.*} | ||
version="${version:1}.x" | ||
echo $version | ||
if [ `git rev-parse --verify $version 2>/dev/null` ]; then | ||
git checkout $version | ||
git merge -s theirs --no-edit --squash $RELEASE_BRANCH_NAME | ||
git commit -m "build: release version $tag_version" | ||
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 |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,6 @@ on: | |
description: 'Branch to cut the release from' | ||
default: main | ||
required: true | ||
releaseBranch: | ||
description: 'Release branch to create (e.g. 1.0.x for version 1.0.0; once created, branch protection rules apply)' | ||
default: dry_run | ||
required: true | ||
dryRun: | ||
description: 'Do a dry run? (true or false)' | ||
default: true | ||
|
@@ -36,6 +32,7 @@ jobs: | |
build: | ||
env: | ||
MAVEN_ARGS: "--no-transfer-progress --batch-mode" | ||
RELEASE_BRANCH_NAME: "__timefold_release_branch__" | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
|
@@ -51,11 +48,15 @@ jobs: | |
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.sourceBranch }} | ||
|
||
- name: Init release branch | ||
continue-on-error: true | ||
run: git push -d origin $RELEASE_BRANCH_NAME | ||
|
||
- name: Create release branch and switch to it | ||
run: | | ||
git config user.name "Timefold Release Bot" | ||
git config user.email "[email protected]" | ||
git checkout -b ${{ github.event.inputs.releaseBranch }} | ||
git checkout -b $RELEASE_BRANCH_NAME | ||
- uses: actions/setup-java@v4 | ||
with: | ||
|
@@ -92,7 +93,7 @@ jobs: | |
git add docs/src/antora.yml | ||
find . -name 'pom.xml' | xargs git add | ||
git commit -m "build: release version ${{ github.event.inputs.version }}" | ||
git push origin ${{ github.event.inputs.releaseBranch }} | ||
git push origin $RELEASE_BRANCH_NAME | ||
- name: Run JReleaser | ||
uses: jreleaser/release-action@v2 | ||
|
@@ -117,16 +118,4 @@ jobs: | |
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
|
||
# Pull Request will be created with the changes and a summary of next steps. | ||
- name: Put back the 999-SNAPSHOT version on the release branch | ||
run: | | ||
git checkout -B ${{ github.event.inputs.releaseBranch }}-put-back-999-snapshot | ||
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 ${{ github.event.inputs.releaseBranch }}-put-back-999-snapshot | ||
gh pr create --reviewer triceo --base ${{ github.event.inputs.releaseBranch }} --head ${{ github.event.inputs.releaseBranch }}-put-back-999-snapshot --title "build: move back to 999-SNAPSHOT" --body-file .github/workflows/release-pr-body.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | ||
if: ${{ github.event.inputs.dryRun == 'false' }} |