Publish npm package via github

This commit is contained in:
Benjamin Toby 2026-03-18 17:48:21 +01:00
parent 9b8e80728e
commit 9be3ceb642
3 changed files with 41 additions and 3 deletions

34
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Publish to npm
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://npm.pkg.github.com"
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@ -172,4 +172,5 @@ out
# Finder (MacOS) folder config
.DS_Store
/test
/test
.bunext

View File

@ -1,8 +1,8 @@
{
"name": "bunext",
"name": "@moduletrace/bunext",
"module": "index.ts",
"type": "module",
"version": "1.0.0",
"version": "1.0.1",
"bin": {
"bunext": "dist/index.js"
},
@ -30,6 +30,9 @@
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"dependencies": {
"@tailwindcss/postcss": "^4.2.1",
"bun-plugin-tailwind": "^0.1.2",