-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.19 KB
/
publish-in-github-registry.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 in GitHub Package Registry
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm test
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Set GitHub Package Registry and Scope
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@supercharge'
- name: Install dependencies
run: npm install
- name: Publish to GitHub Package Registry
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_PUBLISH_GPR_TOKEN}}
# GitHub doesn’t honor the GitHub Package Registry URL from above (looks like a bug)
# Workaround:
# - create a local `.npmrc` file defining the registry URL
# - then go ahead and publish the package
run: |
echo registry=https://npm.pkg.github.com/supercharge >> .npmrc
npm publish