Skip to content

Commit

Permalink
fix: add previous tag version (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu-codecov authored Jan 21, 2025
1 parent a7151b6 commit eb24fb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- id: get-release-vars
name: Configure Release Vars
run: |
echo release_version=$(grep -E "version=\"[0-9]\.[0-9]\.[0-9]\"" setup.py | grep -Eo "[0-9]\.[0-9]\.[0-9]") >> "$GITHUB_OUTPUT"
echo release_version=v$(grep -E "version=\"[0-9]+\.[0-9]+\.[0-9]+\"" setup.py | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT"
echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.CODECOV_RELEASE_PAT }}
run: |
gh release create v${{ steps.get-release-vars.outputs.release_version }} --title "Release v${{ steps.get-release-vars.outputs.release_version }}" --notes "Autogenerated for v${{ steps.get-release-vars.outputs.release_version }}. Created for ${{ github.event.pull_request.html_url }}" --generate-notes --target ${{ github.event.pull_request.head.sha }}
gh release create ${{ steps.get-release-vars.outputs.release_version }} --title "Release ${{ steps.get-release-vars.outputs.release_version }}" --notes "Autogenerated for ${{ steps.get-release-vars.outputs.release_version }}. Created for ${{ github.event.pull_request.html_url }}" --generate-notes --notes-start-tag ${{steps.get-release-vars.outputs.previous_version}} --target ${{ github.event.pull_request.head.sha }}
4 changes: 2 additions & 2 deletions .github/workflows/create_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Update version and push
id: make-commit
run: |
sed -i 's/version="[0-9]\.[0-9]\.[0-9]"/version="${{ github.event.inputs.versionName }}"/g' setup.py
sed -i 's/version="[0-9]+\.[0-9]+\.[0-9]+"/version="${{ github.event.inputs.versionName }}"/g' setup.py
git add setup.py
git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}"
echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
Expand All @@ -46,4 +46,4 @@ jobs:
reviewers: ${{ github.event.issue.user.login }}
body: |
Release PR for ${{ github.event.inputs.versionName }}
I've updated the version name and committed: ${{ steps.make-commit.outputs.commit }}.
I've updated the version name and committed: ${{ steps.make-commit.outputs.commit }}.

0 comments on commit eb24fb1

Please sign in to comment.