Deploy Release to GitHub #1
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: Deploy Release to GitHub | |
on: | |
workflow_dispatch: | |
inputs: | |
release-type: | |
description: What is the type of this release? | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
default: minor | |
pre-release: | |
description: Is this a pre-release? | |
required: true | |
type: boolean | |
default: false | |
env: | |
GITHUB_AUTH: ${{ secrets.PUSH_TOKEN }} | |
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ env.PUSH_TOKEN }} | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node v18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
- name: Set Git Config | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ env.GPG_PRIVATE_KEY }} | |
passphrase: ${{ env.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Install dependencies | |
run: pnpm i | |
- name: Publish pre-release version on GitHub | |
if: ${{ inputs.pre-release }} | |
run: pnpm release:pre${{ inputs.release-type }} | |
- name: Publish stable release version on GitHub | |
if: ${{ ! inputs.pre-release }} | |
run: pnpm release:${{ inputs.release-type }} |