Skip to content

Commit 1ad94ab

Browse files
committed
switched npm-publish to shared actions & cleaned up workflows
1 parent 1631b89 commit 1ad94ab

3 files changed

Lines changed: 19 additions & 74 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: build
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
uses: userscripters/shared-actions/.github/workflows/workflow-nodejs.yml@master
6+
build:
7+
uses: userscripters/shared-actions/.github/workflows/workflow-nodejs.yml@master

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,10 @@
11
name: Publish a package
22

33
on:
4-
release:
5-
types: [published]
4+
release:
5+
types: [released]
6+
workflow_dispatch:
67

78
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Using Node 16
14-
uses: actions/setup-node@v3
15-
with:
16-
node-version: 16
17-
- name: Update npm version to latest
18-
run: npm install -g npm@latest
19-
- name: Install dependencies
20-
run: |
21-
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
22-
npm install
23-
env:
24-
NODE_AUTH_TOKEN: ${{github.token}}
25-
- name: Compile
26-
run: npm run build
27-
- name: Run tests
28-
run: npm run test
29-
30-
publish-gh:
31-
needs: build
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-node@v3
36-
with:
37-
node-version: 16
38-
registry-url: "https://registry.npmjs.org"
39-
scope: "@${{github.repository_owner}}"
40-
- run: npm install
41-
- run: |
42-
npm config set @${{github.repository_owner}}:registry https://npm.pkg.github.com
43-
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
44-
npm publish --access public
45-
env:
46-
NODE_AUTH_TOKEN: ${{secrets.PAT}}
47-
48-
publish-npm:
49-
needs: build
50-
runs-on: ubuntu-latest
51-
steps:
52-
- uses: actions/checkout@v3
53-
- uses: actions/setup-node@v3
54-
with:
55-
node-version: 16
56-
registry-url: "https://registry.npmjs.org"
57-
scope: "@${{github.repository_owner}}"
58-
- run: npm install
59-
env:
60-
NODE_AUTH_TOKEN: ${{github.token}}
61-
- run: |
62-
npm config set @${{github.repository_owner}}:registry https://registry.npmjs.org
63-
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
64-
npm publish --access public
65-
env:
66-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
9+
build:
10+
uses: userscripters/shared-actions/.github/workflows/workflow-npm_publish.yml@master

.github/workflows/release.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
name: "release"
22

33
on:
4-
push:
5-
tags:
6-
- "*"
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
78

89
jobs:
9-
release:
10-
runs-on: "ubuntu-latest"
10+
release:
11+
runs-on: "ubuntu-latest"
1112

12-
steps:
13-
- uses: actions/checkout@v3
14-
- uses: "marvinpinto/action-automatic-releases@latest"
15-
with:
16-
repo_token: "${{ secrets.PAT }}"
17-
prerelease: false
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: "marvinpinto/action-automatic-releases@latest"
16+
with:
17+
repo_token: "${{ secrets.PAT }}"
18+
prerelease: false

0 commit comments

Comments
 (0)