-
Notifications
You must be signed in to change notification settings - Fork 68
62 lines (52 loc) · 1.83 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
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Release for tag
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
permissions:
# needed for npm provenance data generation
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write
env:
# https://github.com/chalk/supports-color/blob/main/index.js#L21
# https://github.com/chalk/supports-color/blob/main/index.js#L54
FORCE_COLOR: true
steps:
- name: Checkout
# https://github.com/actions/checkout
uses: actions/checkout@v3
with:
# Number of commits to fetch. 0 indicates all history.
fetch-depth: 1
- name: Prepare for building
uses: ./.github/actions/prepare
- name: Build Packages
run: |
pnpm build:packages
- name: Publish to npm
# https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
id: publish-to-npm
env:
# need set in GitHub repo - settings - secrets
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools
NPM_CONFIG_PROVENANCE: true
run: |
echo 'Show .npmrc'
cat ./.npmrc
echo ''
if [[ "${GITHUB_REF##*/}" =~ .*-beta ]]; then
echo "Publishing beta version..."
pnpm publish -r --report-summary --tag beta
else
echo "Publishing latest version..."
pnpm publish -r --report-summary
fi
echo ''
echo 'Show pnpm-publish-summary.json'
echo ''
cat pnpm-publish-summary.json