Skip to content

Commit ec23075

Browse files
committed
ci: 🎡 npm publish workflow changes
This commit includes npm publish workflow changes for direct publishing
1 parent 83d7cc6 commit ec23075

File tree

3 files changed

+45
-24
lines changed

3 files changed

+45
-24
lines changed

.github/workflows/npm-publish.yml

+43-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1-
name: npm-publish
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
26
on:
3-
push:
4-
branches:
5-
- master
7+
release:
8+
types: [created]
9+
610
jobs:
7-
npm-publish:
8-
name: npm-publish
11+
build:
912
runs-on: ubuntu-latest
1013
steps:
11-
- name: Checkout repository
12-
uses: actions/checkout@master
13-
- name: Set up Node.js
14-
uses: actions/setup-node@master
15-
with:
16-
node-version: 10.0.0
17-
- name: Publish if version has been updated
18-
uses: pascalgn/npm-publish-action@06e0830ea83eea10ed4a62654eeaedafb8bf50fc
19-
with:
20-
tag_name: "v%s"
21-
tag_message: "v%s"
22-
commit_pattern: "^Release (\\S+)"
23-
workspace: "."
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
- run: npm ci
19+
- run: npm test
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v1
27+
with:
28+
node-version: 12
29+
registry-url: https://registry.npmjs.org/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
34+
35+
publish-gpr:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions/setup-node@v1
41+
with:
42+
node-version: 12
43+
registry-url: https://npm.pkg.github.com/
44+
- run: npm ci
45+
- run: npm publish
46+
env:
47+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fastify-typescript-generator",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Generate new Fastify applications similar to express-generate which but sets it up to use TypeScript instead",
55
"preferGlobal": true,
66
"scripts": {

0 commit comments

Comments
 (0)