Skip to content

Commit

Permalink
ci: create major and minor tags on release for actions version
Browse files Browse the repository at this point in the history
  • Loading branch information
aj3sh committed Jul 24, 2024
1 parent ea7683f commit cb8a5ad
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,32 @@ jobs:
steps:
- name: Release
id: release
uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3

- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
# setup github actions bot as author
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# removing previous tags
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
# creating new tags
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
if: ${{ steps.release.outputs.release_created }}
with:
python-version: '3.x'
Expand Down

0 comments on commit cb8a5ad

Please sign in to comment.