Skip to content

Commit 7a5d20e

Browse files
author
JungleRaja Dev
committed
Update github actions
1 parent fab24d9 commit 7a5d20e

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

.github/workflows/publish.yaml

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Publish
1+
name: Publish package to npmjs
22
on:
3-
workflow_run:
4-
workflows: [CI]
5-
branches: [main]
6-
types: [completed]
3+
release:
4+
types: [published]
75

86
concurrency: ${{ github.workflow }}-${{ github.ref }}
97

@@ -13,24 +11,19 @@ permissions:
1311

1412
jobs:
1513
publish:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1714
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: pnpm/action-setup@v2
21-
with:
22-
version: 7
23-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
2421
with:
2522
node-version: 20.x
2623
cache: "npm"
24+
registry-url: "https://registry.npmjs.org"
2725

28-
- run: npm install
29-
- name: Create Release Pull Request or Publish
30-
id: changesets
31-
uses: changesets/action@v1
32-
with:
33-
publish: npm run release
26+
- run: npm ci
27+
- run: npm publish --provenance --access public
3428
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
1919
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
2020
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
21-
"test": "npm run clean && vitest",
21+
"test": "npm run clean && vitest --run",
2222
"test:coverage": "vitest run --coverage",
2323
"prepare": "npm run build",
2424
"prepublishOnly": "npm run test && npm run lint",

0 commit comments

Comments
 (0)