Release #2
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
new-version: | |
description: 'Version to be released.' | |
type: string | |
required: true | |
update-prerelease-into-latest: | |
description: 'Update pre-release into latest.' | |
type: boolean | |
default: true | |
delete-rc-branch: | |
description: 'Delete rc* branch at the end of process.' | |
type: boolean | |
default: true | |
jobs: | |
run-lint-on-rc: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.new-version }} | |
steps: | |
- name: Checkout into rc${{ inputs.new-version }} | |
uses: actions/checkout@v4 | |
with: | |
ref: rc${{ inputs.new-version }} | |
token: ${{ secrets.PAT }} | |
- name: Install project dependencies | |
run: npm install | |
- name: Run build | |
run: npm run build | |
merge-rc-into-main: | |
needs: run-lint-on-rc | |
runs-on: ubuntu-latest | |
if: ${{ inputs.new-version }} | |
steps: | |
- name: Merge rc${{ inputs.new-version }} into main | |
uses: everlytic/[email protected] | |
with: | |
github_token: ${{ secrets.PAT }} | |
source_ref: rc${{ inputs.new-version }} | |
target_branch: 'main' | |
commit_message_template: 'Merged rc${{ inputs.new-version }} into main. [skip ci]' | |
set-pre-release-as-lts: | |
needs: merge-rc-into-main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update v${{ inputs.new-version }} Tag Release from pre-release into latest | |
if: ${{ inputs.new-version && inputs.update-prerelease-into-latest == true }} | |
uses: softprops/[email protected] | |
with: | |
tag_name: v${{ inputs.new-version }} | |
prerelease: false | |
token: ${{ secrets.PAT }} | |
delete-rc-branch: | |
needs: merge-rc-into-main | |
runs-on: ubuntu-latest | |
if: ${{ inputs.delete-rc-branch == true }} | |
steps: | |
- name: Checkout branch dev | |
uses: actions/checkout@v4 | |
with: | |
ref: dev | |
- name: Delete branch rc${{ inputs.new-version }} | |
shell: bash | |
run: | | |
git push origin -d rc${{ inputs.new-version }} |