Skip to content

Commit 5e07209

Browse files
committed
Update GitHub Actions workflow to use actions/checkout@v4 and actions/setup-node@v4
1 parent ca03313 commit 5e07209

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
name: NPM Publish
22
on:
3-
push:
4-
branches:
5-
- main
3+
release:
4+
types: [published]
65

76
jobs:
8-
publish-gpr:
7+
publish:
98
runs-on: ubuntu-latest
109

1110
steps:
1211
- uses: actions/checkout@v4
1312

14-
# Set Git user name and email
15-
- name: Set Git user name and email
16-
run: |
17-
git config --global user.email "[email protected]"
18-
git config --global user.name "itsfuad"
19-
20-
- uses: actions/setup-node@v4
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v4
2115
with:
22-
node-version: 20
23-
registry-url: https://npm.pkg.github.com/
24-
scope: '@itsfuad'
16+
node-version: '20.x'
17+
registry-url: 'https://registry.npmjs.org'
2518

26-
- run: npm install
27-
- run: npx tsc
19+
- name: Install dependencies by npm
20+
run: npm install
2821

29-
# Run npm version to auto-increment the version number
30-
- name: Auto-increment version number
31-
run: npm version patch --force
32-
env:
33-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
22+
- name: Run typescript to compile
23+
run: tsc
3424

35-
# Publish the package with the updated version number
36-
- run: npm publish
25+
- name: Publish to NPM
26+
run: npm publish --access public
3727
env:
38-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
28+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
29+
30+
31+

0 commit comments

Comments
 (0)