-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (57 loc) · 2.25 KB
/
master-push.yml
File metadata and controls
59 lines (57 loc) · 2.25 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 'Master Push'
on:
# run on master pushes to manage the version in the release branch
push:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# push updates and a version bump to the release branch
version-bump:
name: 'Version Bump and Start Release'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
fetch-depth: 0
- name: 'Configure GitHub user'
run: |
git config user.name devops
git config user.email devops@runtimeverification.com
- name: 'Get uv release'
id: uv_release
run: |
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}"
- name: 'Install uv'
uses: astral-sh/setup-uv@v6
with:
version: ${{ steps.uv_release.outputs.uv_version }}
- name: 'Update release branch with current master'
run: |
git checkout -B release origin/release
prior_version=$(cat package/version)
old_master="$(git merge-base origin/master origin/release)"
new_master="$(git rev-parse origin/master)"
# otherwise bump the prior_version
if git diff --exit-code ${old_master} ${new_master} -- package/version; then
git merge --no-edit origin/master
package/version.sh bump ${prior_version}
else
# if the version has changed on master, use it unmodified
git merge --no-edit --strategy-option=theirs origin/master
fi
# substitute the version in all relevant files
package/version.sh sub
uv --directory kmir lock --no-upgrade
# add changes to staging and commit (if there are any)
if git add --update && git commit --no-edit --allow-empty --message "Set Version: $(cat package/version)"; then
# Push the changes to the release branch -- Trigger the Release Process and Testing
git push origin release
# tag master with a release tag
git tag "release-$(cat package/version)" origin/master
git push origin "release-$(cat package/version)"
fi