Github Release #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Release | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
workflow_dispatch: | |
jobs: | |
create-tag: | |
runs-on: ubuntu-latest | |
if: (github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'autorelease')) || (github.event_name == 'workflow_dispatch') | |
permissions: | |
contents: write | |
outputs: | |
tag_name: ${{ steps.read-changelog.outputs.version }} | |
github-app-token: ${{ steps.app-token.outputs.token }} | |
steps: | |
- name: Generate Token for sbb-app-bakery GH App | |
id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.APPBAKERYGITHUBAPP_APPID }} | |
private-key: ${{ secrets.APPBAKERYGITHUBAPP_PRIVATEKEY }} | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
persist-credentials: false | |
- name: Changelog Reader | |
id: read-changelog | |
uses: mindsers/[email protected] | |
- name: Create release tag | |
uses: rickstaa/[email protected] | |
with: | |
github_token: ${{ steps.app-token.outputs.token }} | |
tag: ${{ steps.read-changelog.outputs.version }} | |
message: "Version Release ${{ steps.read-changelog.outputs.version }} on ${{ steps.read-changelog.outputs.date }}" | |
create-github-release: | |
runs-on: ubuntu-latest | |
needs: create-tag | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ needs.create-tag.outputs.github-app-token }} | |
ref: refs/tags/${{ needs.create-tag.outputs.tag_name }} | |
persist-credentials: false | |
- name: Create GitHub Releases based on changelog | |
uses: taiki-e/[email protected] | |
with: | |
token: ${{ needs.create-tag.outputs.github-app-token }} | |
ref: refs/tags/${{ needs.create-tag.outputs.tag_name }} | |
changelog: ./CHANGELOG.md |