-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (32 loc) · 1019 Bytes
/
npm_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
name: Publish to GitHub Packages
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
publish-gpr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://npm.pkg.github.com'
scope: '@gitset-dev'
- name: Update package name for GitHub Packages
run: |
cp package.json package.json.backup
npm pkg set name=@gitset-dev/gitset-cli
- name: Publish to GitHub Packages
run: |
echo "registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_GITHUB }}
- name: Restore original package.json
run: mv package.json.backup package.json