Skip to content

Commit 2e87f04

Browse files
committed
clean up yml files and add publishing to packages
1 parent f528193 commit 2e87f04

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed
Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to GitHub Packages
1+
name: NPM Publish
22

33
on:
44
release:
@@ -10,33 +10,19 @@ permissions:
1010
packages: write
1111

1212
jobs:
13-
publish:
13+
build:
1414
runs-on: ubuntu-latest
15-
1615
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
20-
- name: Use Node.js 20
21-
uses: actions/setup-node@v4
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
2218
with:
2319
node-version: 20
24-
registry-url: https://npm.pkg.github.com/
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Build
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: npm ci
22+
- name: Build distribution
3023
run: npm run build:dist
3124

32-
- name: Sync version from tag
33-
run: |
34-
TAG="${GITHUB_REF_NAME}" # for example. v1.2.3
35-
VERSION="${TAG#v}" # 1.2.3
36-
echo "Version from tag: $VERSION"
37-
npm version "$VERSION" --no-git-tag-version
38-
39-
- name: Publish
25+
- name: Publish to npm
26+
run: npm publish --access public
4027
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
run: npm publish
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)