diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index 67ad13f8..939642aa 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -9,6 +9,7 @@ on: tag_name: description: "The tag name" value: ${{ jobs.release_please.outputs.tag_name }} + workflow_dispatch: permissions: @@ -19,10 +20,25 @@ jobs: release_please: runs-on: ubuntu-latest outputs: - release_created: ${{ steps.release_please.outputs.release_created }} - tag_name: ${{ steps.release_please.outputs.tag_name }} + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} steps: - uses: google-github-actions/release-please-action@v4 - id: release_please + id: release with: release-type: simple + - uses: actions/checkout@v4 + - name: tag major and minor versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" + 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 + 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 }}