docs: add PR template
[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
8d9bfb08 15 if: github.repository == 'sap/e-mobility-charging-stations-simulator'
2c02376b
JB
16 steps:
17 - uses: googleapis/release-please-action@v4
18 id: release
19 with:
ce4b6698 20 token: ${{ secrets.WORKFLOW_TOKEN }}
2c02376b
JB
21 config-file: .github/release-please/config.json
22 manifest-file: .github/release-please/manifest.json
60b14fe6 23 - name: Create tags for major and minor versions
2c02376b
JB
24 if: ${{ steps.release.outputs.release_created }}
25 run: |
26 git config user.name github-actions[bot]
27 git config user.email 41898282+github-actions[bot]@users.noreply.github.com
28 git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git"
29 git tag -d v${{ steps.release.outputs.major }} || true
30 git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
31 git push origin :v${{ steps.release.outputs.major }} || true
32 git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
33 git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
34 git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
35 git push origin v${{ steps.release.outputs.major }}
36 git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}