-
Notifications
You must be signed in to change notification settings - Fork 43
83 lines (75 loc) · 2.6 KB
/
master.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: 'Bump version and make release job'
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ghc_version: "9.6.5"
stack_version: "2.15.1"
hpack_version: '0.36'
jobs:
cache-stack:
name: 'Cache Stack'
runs-on: ubuntu-22.04
steps:
- name: Install prerequisites
run: |
sudo apt install --yes z3 libsecp256k1-dev
- name: Check out code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Stack root
uses: actions/cache@v4
with:
path: ~/.stack
key: stack-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
restore-keys: |
stack-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
stack-${{ runner.os }}-ghc-${{ env.ghc_version }}
- uses: haskell-actions/[email protected]
id: setup-haskell-stack
with:
ghc-version: ${{ env.ghc_version }}
stack-version: ${{ env.stack_version }}
enable-stack: true
stack-setup-ghc: true
- name: Build all
run: |
stack build --test --no-run-tests --pedantic
- name: Run unit tests
run: stack test kore:kore-test hs-backend-booster:unit-tests
version-bump:
name: 'Version Bump'
runs-on: ubuntu-latest
needs: [cache-stack]
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 [email protected]
git checkout -B release origin/release
old_master="$(git merge-base origin/master origin/release)"
new_master="$(git rev-parse origin/master)"
if git diff --exit-code ${old_master} ${new_master} -- package/version; then
git merge --no-edit origin/master
./package/version.sh bump
else
git merge --no-edit --strategy-option=theirs origin/master
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 release
git tag "release-$(cat package/version)" origin/master
git push origin "release-$(cat package/version)"
fi