Update dependency: deps/k_release (#4068) #104
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
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 |