-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (91 loc) · 2.64 KB
/
node-release.yml
File metadata and controls
99 lines (91 loc) · 2.64 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# need env: NPM_TOKEN add at to action secrets, npm token doc see https://docs.npmjs.com/about-access-tokens/
name: node-release
on:
workflow_call: # https://docs.github.com/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow
inputs:
dry-run:
description: 'Run npm publish with the --dry-run flag'
default: false
required: true
type: boolean
npm_version:
description: 'tag name'
default: ''
required: false
type: string
npm_distribution:
description: 'npm distribution see https://docs.npmjs.com/cli/v9/commands/npm-publish#tag'
default: 'latest'
required: false
type: string
tag_name:
description: 'tag name, if not tag will null'
default: ''
required: false
type: string
tag_changes:
description: 'tag changes, if not tag will null'
default: ''
required: false
type: string
# upload_artifact_name:
# description: 'upload artifact name'
# default: ''
# required: false
# type: string
jobs:
build-upload:
defaults:
run:
shell: bash
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
-
name: Install dependencies
run: |
npm install
node -v
-
name: Run code check
run: |
npm run lint
npm test
# - name: Check Release archive
# if: ${{ inputs.upload_artifact_name != null }}
# run: |
# echo "release archive at: ${{ env.ASSET }}"
# echo " archive sha256sum at: ${{ env.ASSET }}.sha256"
# - name: upload-artifact
# uses: actions/upload-artifact@v4
# if: ${{ inputs.upload_artifact_name != null }}
# with:
# name: ${{ inputs.upload_artifact_name }}
# retention-days: 5
# if-no-files-found: error
# path: |
# ${{ env.ASSET }}
# ${{ env.ASSET }}.sha256
publish-npm:
needs:
- build-upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
-
name: Install dependencies
run: |
npm install
node -v
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ inputs.npm_distribution }}
dry-run: ${{ inputs.dry-run }}