Update dependency: deps/kevm_release (#732) #453
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 Release' | |
on: | |
push: | |
branches: | |
- 'master' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
version-bump: | |
name: 'Version Bump Start Release' | |
runs-on: ubuntu-latest | |
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: 'Configure GitHub user' | |
run: | | |
git config user.name rv-jenkins | |
git config user.email [email protected] | |
- name: 'Update version' | |
run: | | |
# Check out the release branch and create it if it doesn't exist | |
git checkout -B release origin/release | |
# Get the common ancestor commit between master and release branches | |
old_master="$(git merge-base origin/master origin/release)" | |
# Get the latest commit hash on the master branch | |
new_master="$(git rev-parse origin/master)" | |
# Check if there are changes in the package/version file between the common ancestor and the latest master commit | |
if git diff --exit-code ${old_master} ${new_master} -- package/version; then | |
# If there are no changes, bump the version based on the current version in master | |
og_version=$(git show origin/master:package/version) | |
./package/version.sh bump ${og_version} | |
else | |
# If there are changes, merge master into release with 'theirs' strategy to resolve conflicts | |
git merge --no-edit --strategy-option=theirs origin/master | |
fi | |
# Substitute the version in the package/version file | |
./package/version.sh sub | |
new_version=$(cat package/version) | |
# Update the version in the kontrol module's __init__.py file | |
sed --in-place "s/^VERSION: Final = '.*'$/VERSION: Final = '${new_version}'/" src/kontrol/__init__.py | |
# Add changes to the staging area and commit them if there are any changes | |
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 | |
fi | |
bump-master-branch: | |
name: 'Bump Master Branch' | |
needs: version-bump | |
runs-on: ubuntu-latest | |
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: 'Configure GitHub user' | |
run: | | |
git config user.name rv-jenkins | |
git config user.email [email protected] | |
- name: 'Bump Master Branch' | |
run: | | |
git checkout -B master origin/master | |
git fetch origin release:release | |
git merge --no-edit --strategy-option=theirs -m "Merge release into master [skip ci]" origin/release | |
git push origin master |