forked from TimefoldAI/timefold-solver
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.34 KB
/
finish_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
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 "[email protected]"
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