-
-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (49 loc) · 1.5 KB
/
npm-release.yml
File metadata and controls
53 lines (49 loc) · 1.5 KB
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
name: Node.js Package Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'admin/package.json'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.3
with:
node-version: 20
- name: Install dependencies
run: npm install
working-directory: ./admin
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.3
with:
node-version: 20
- name: Configure npm for npm registry
run: |
echo "@pleasure1234:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
working-directory: ./admin
- name: Publish to npm
run: npm publish
working-directory: ./admin
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure npm for GitHub Packages
run: |
echo "@NottinghamWall:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" >> .npmrc
working-directory: ./admin
- name: Publish to GitHub Packages
run: npm publish --registry=https://npm.pkg.github.com/
working-directory: ./admin
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}