Skip to content

Commit 594e046

Browse files
committed
RV-OPT [OPT] -> actions
1 parent d5b8971 commit 594e046

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1-
name: Publish to NPM
1+
name: Publish Over NPM
22

33
on:
4+
push:
5+
branches: [ main ]
46
release:
5-
types: [created]
7+
types: [ created ]
68

79
jobs:
810
build:
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v3
12-
14+
1315
- name: Setup Node.js
1416
uses: actions/setup-node@v3
1517
with:
1618
node-version: '20.x'
1719
registry-url: 'https://registry.npmjs.org'
18-
20+
1921
- name: Install dependencies
2022
run: npm ci
21-
23+
2224
- name: Build
2325
run: npm run build
24-
26+
27+
- name: Create .npmrc file
28+
run: |
29+
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> .npmrc
30+
2531
- name: Publish to NPM
26-
run: npm publish
32+
run: npm publish --access public
2733
env:
28-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/publish.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Publish Package
1+
name: Publish Over Github Packages
22

33
on:
4+
push:
5+
branches: [ main ]
46
release:
5-
types: [created]
7+
types: [ created ]
68

79
jobs:
810
build:
@@ -12,26 +14,26 @@ jobs:
1214
packages: write
1315
steps:
1416
- uses: actions/checkout@v3
15-
17+
1618
- name: Setup Node.js
1719
uses: actions/setup-node@v3
1820
with:
1921
node-version: '20.x'
2022
registry-url: 'https://npm.pkg.github.com'
2123
scope: '@th3hero'
22-
24+
2325
- name: Install dependencies
2426
run: npm ci
25-
27+
2628
- name: Build
2729
run: npm run build
28-
30+
2931
- name: Create .npmrc file
3032
run: |
3133
echo "@th3hero:registry=https://npm.pkg.github.com/" >> .npmrc
3234
echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" >> .npmrc
33-
35+
3436
- name: Publish to GitHub Packages
35-
run: npm publish
37+
run: npm publish --access public
3638
env:
3739
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)