-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (57 loc) · 1.7 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
name: Release
on:
push:
branches:
- main
env:
NODE_VERSION: 18.10.0
PNPM_VERSION: 8
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
release:
name: Release
if: contains(github.event.head_commit.message, 'RELEASE')
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@v2
with:
private_key: ${{ secrets.RELEASE_APP_PEM }}
app_id: ${{ secrets.RELEASE_APP_ID }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# persist-credentials: false
token: ${{ steps.get_token.outputs.token }}
ref: ${{ github.ref }}
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
env:
CI: true
- name: Build
run: npm run version:ci
env:
CI: true
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Run pnpm publish
run: pnpm -r publish --access=public --no-git-checks
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }}
- name: Push versions, changelog and tags
run: git push --atomic origin main $(git tag -l)
env:
CI: true
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}