forked from Doist/reactist
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.81 KB
/
publish.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
name: Release @doist/reactist package
on:
release:
types: [created]
workflow_dispatch:
permissions:
# Enable the use of OIDC for npm provenance
id-token: write
# Enable the use of GitHub Packages registry
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
# Based on historical data
timeout-minutes: 60
steps:
- uses: actions/checkout@v1
- name: Read Node.js version from '.nvmrc'
id: nvmrc
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
# Remove any registry configurations from .npmrc
- run: sed -i "/@doist/d" ./.npmrc
- run: npm ci
- run: npm run lint
- run: npm run type-check
- run: npm test
# Build artifacts for publishing
- run: npm run build
# Publish to GitHub package registry
- uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
registry-url: https://npm.pkg.github.com/
scope: '@doist'
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# Publish to npm registry
- uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
scope: '@doist'
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}