fix: ensure checks are run on release PR
[e-mobility-charging-stations-simulator.git] / .github / workflows / release-please.yml
CommitLineData
2c02376b
JB
1name: Release Please
2
3on:
4 push:
5 branches:
6 - main
7
8cf1b9ef
JB
8permissions:
9 contents: write
10 pull-requests: write
11
2c02376b
JB
12jobs:
13 release-please:
14 runs-on: ubuntu-latest
15 steps:
16 - uses: googleapis/release-please-action@v4
17 id: release
18 with:
ce4b6698 19 token: ${{ secrets.WORKFLOW_TOKEN }}
2c02376b
JB
20 config-file: .github/release-please/config.json
21 manifest-file: .github/release-please/manifest.json
60b14fe6 22 - name: Create tags for major and minor versions
2c02376b
JB
23 if: ${{ steps.release.outputs.release_created }}
24 run: |
25 git config user.name github-actions[bot]
26 git config user.email 41898282+github-actions[bot]@users.noreply.github.com
27 git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git"
28 git tag -d v${{ steps.release.outputs.major }} || true
29 git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
30 git push origin :v${{ steps.release.outputs.major }} || true
31 git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
32 git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
33 git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
34 git push origin v${{ steps.release.outputs.major }}
35 git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}