-
Notifications
You must be signed in to change notification settings - Fork 150
39 lines (37 loc) · 1.26 KB
/
develop.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
name: 'Bump version and make master job'
on:
push:
branches:
- 'develop'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-bump:
name: 'Version Bump'
runs-on: ubuntu-24.04
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
- name: 'Update Version'
run: |
set -x
git config user.name devops
git config user.email devops@runtimeverification.com
git checkout -B master origin/master
old_develop="$(git merge-base origin/develop origin/master)"
new_develop="$(git rev-parse origin/develop)"
if git diff --exit-code "${old_develop}" "${new_develop}" -- package/version; then
git merge --no-edit origin/develop
./package/version.sh bump
else
git merge --no-edit --strategy-option=theirs origin/develop
fi
./package/version.sh sub
if git add --update && git commit --no-edit --allow-empty --message "Set Version: $(cat package/version)"; then
git push origin master
fi