-
-
Notifications
You must be signed in to change notification settings - Fork 11
67 lines (54 loc) · 1.61 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
60
61
62
63
64
65
66
67
name: Publish Package
on:
release:
types: [published]
workflow_dispatch:
# First we will publish the package to GitHub packages then later to NPM,
# so that it is updated on both, but registers download analytics only on NPM.
jobs:
publish-gh-packages:
name: Publish package to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- name: Setup Web environment
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'yarn'
- name: Install packages
run: yarn install --frozen-lockfile
- name: Build the plugin
run: yarn build
- name: Publish Package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npmjs:
name: Publish package to npmjs
runs-on: ubuntu-latest
needs: publish-gh-packages
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- name: Setup Web environment
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install packages
run: yarn install --frozen-lockfile
- name: Build the plugin
run: yarn build
- name: Publish Package
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}