-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.16 KB
/
Copy pathnpmpublish.yml
File metadata and controls
43 lines (38 loc) · 1.16 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
name: Node.js Package
on:
release:
types: [created]
jobs:
publish-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
cache: "npm"
registry-url: https://registry.npmjs.org/
- run: npm install -g npm@latest
- run: npm ci
- run: npm run build
- id: branch_name
name: Get branch name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- id: update_version
name: Update version
run: |
npm --no-git-tag-version version $SOURCE_TAG
env:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
cache: "npm"
registry-url: https://registry.npmjs.org/
scope: "@validide"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}