-
-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (43 loc) · 1.49 KB
/
setup-package.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
name: Publish package to GitHub Packages and NPM.js
on:
release:
types: [published]
jobs:
githubPackages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
# Defaults to the user or organization that owns the workflow file
scope: "@fajarkim"
- run: npm ci
- run: npm publish --public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npmJs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# Setup .npmrc file to publish to NPM.js
- run: mv .npmrc.bak .npmrc
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
scope: "@fajarkim"
- run: sed -i "s@https://npm.pkg.github.com@https://registry.npmjs.org@g" package.json
- run: npm ci
- run: npm publish --public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}