From 9be3ceb6426944d0ca96d2d24a0fb58b4061021a Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Wed, 18 Mar 2026 17:48:21 +0100 Subject: [PATCH] Publish npm package via github --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- package.json | 7 +++++-- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0cf2040 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 49252e7..0105a8c 100644 --- a/.gitignore +++ b/.gitignore @@ -172,4 +172,5 @@ out # Finder (MacOS) folder config .DS_Store -/test \ No newline at end of file +/test +.bunext \ No newline at end of file diff --git a/package.json b/package.json index e8bc1e7..e66b705 100644 --- a/package.json +++ b/package.json @@ -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",