Skip to content

Commit

Permalink
Merge pull request #4 from rathod-sahaab/feat/npm-publish
Browse files Browse the repository at this point in the history
Feat/npm publish
  • Loading branch information
rathod-sahaab authored Nov 14, 2024
2 parents 04b14e1 + cc0f034 commit 03b2029
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish JSR
name: Publish

on:
push:
Expand Down Expand Up @@ -28,14 +28,41 @@ jobs:
run: pnpm run build
- name: Test
run: pnpm run test
- name: Upload Build as artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist

publish:
publish-jsr:
runs-on: ubuntu-latest
environment: Production
environment: jsr
needs: build
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish

publish-npm:
runs-on: ubuntu-latest
environment: npm
needs: build
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Download dist artifact
uses: actions/download-artifact@v2
with:
name: dist
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ src
.prettierrc
tsconfig.json
vite.config.ts
jsr.json
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rathod-sahaab/http-result",
"version": "0.5.3",
"version": "0.5.4",
"exports": {
".": "./src/index.ts"
"./ts-rest": "./src/ts-rest/index.ts"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"error-handling"
],
"private": false,
"version": "0.5.3",
"version": "0.5.4",
"type": "module",
"main": "./dist/http-result.umd.cjs",
"module": "./dist/http-result.js",
Expand Down

0 comments on commit 03b2029

Please sign in to comment.