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