Skip to content

Commit

Permalink
Rework minor_version_release.yml to create PR that bumps version
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed May 3, 2024
1 parent 5f81337 commit 88286d5
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/minor_version_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,35 @@ jobs:
- name: Bump version on ${{ steps.branch.outputs.name }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# We use the HAYSTACK_BOT_TOKEN here so the PR created by the step will
# trigger required workflows and can be merged by anyone
GITHUB_TOKEN: ${{ secrets.HAYSTACK_BOT_TOKEN }}
run: |
git checkout "${{ steps.branch.outputs.name }}"
# Tag the base with X.Y.Z-rc0.
# At this point VERSION.txt still contains the previous version and not
# the one specified by the tag.
# This is good though as we just need this to make reno work properly.
NEW_VERSION=$(awk -F. '/[0-9]+\./{$2++;print}' OFS=. < VERSION.txt)
echo "$NEW_VERSION" > VERSION.txt
VERSION_TAG="v$NEW_VERSION"
git tag "$VERSION_TAG" -m"$VERSION_TAG"
git push --tags
# Create the branch that bump version in dev branch
cat VERSION.txt
git checkout -b bump-version
git add .
git commit -m "Update unstable version to $NEW_VERSION"
VERSION_TAG="v$NEW_VERSION"
git tag "$VERSION_TAG" -m"$VERSION_TAG"
git push --atomic origin "${{ steps.branch.outputs.name }}" "$VERSION_TAG"
g push -u origin bump-version
# Create the PR
gh pr create -B "${{ steps.branch.outputs.name }}" \
-H bump-version \
--title 'Bump unstable version' \
--body 'Part of the release process' \
--label 'ignore-for-release-notes'
- uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit 88286d5

Please sign in to comment.