Create Release #18
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: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
mode: | |
type: choice | |
description: "Release mode" | |
required: true | |
default: patch | |
options: | |
- patch | |
- minor | |
- major | |
# Allow only one concurrent release, and wait for the current one to finish | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
github-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref || github.ref_name }} | |
token: ${{ secrets.RELEASE_PAT_TOKEN }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Create tag | |
id: tag-changelog | |
shell: bash | |
working-directory: ${{ github.workspace }}/.github/workflows | |
env: | |
mode: ${{ inputs.mode }} | |
workspace: ${{ github.workspace }} | |
run: ./scripts/release.sh | |
- name: Create Github Release | |
if: success() && steps.tag-changelog.outputs.new_version != '' | |
env: | |
tag: ${{ steps.tag-changelog.outputs.new_version }} | |
GH_TOKEN: ${{ secrets.RELEASE_PAT_TOKEN }} | |
shell: bash | |
run: | | |
gh release create "$tag" \ | |
--repo "$GITHUB_REPOSITORY" \ | |
--title "${GITHUB_REPOSITORY#*/} ${tag#v}" \ | |
--generate-notes \ | |
--verify-tag |