Skip to content

Commit

Permalink
setup publish with provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Sep 11, 2024
1 parent 57296d7 commit 9f3635d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Package to npm
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: 22
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: pnpm build
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Run Biome
run: biome ci .
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "module",
"keywords": ["body-parser", "express", "http", "body-parsing"],
"engines": {
"node": ">=12.20"
"node": ">=18"
},
"exports": "./dist/index.js",
"devDependencies": {
Expand All @@ -30,5 +30,8 @@
"build": "tsc -p tsconfig.build.json",
"prepublishOnly": "pnpm build && pnpm test"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"publishConfig": {
"provenance": true
}
}

0 comments on commit 9f3635d

Please sign in to comment.