-
-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (57 loc) · 1.72 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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 }}