Skip to content

Commit 58b3112

Browse files
authored
cleanup release workflow (#44)
1 parent a5c3c1f commit 58b3112

File tree

4 files changed

+28
-47
lines changed

4 files changed

+28
-47
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: Release Please
2-
1+
name: Release Package
32
on:
43
push:
54
branches:
@@ -8,47 +7,47 @@ on:
87
permissions:
98
contents: write
109
pull-requests: write
10+
issues: write
1111

1212
jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release-please.outputs.release_created }}
1517
steps:
1618
- uses: googleapis/release-please-action@v4
17-
id: release
19+
id: release-please
1820
with:
19-
config-file: .release-please-config.json
20-
manifest-file: .release-please-manifest.json
21+
release-type: node
2122

22-
- uses: actions/checkout@v4
23-
if: ${{ steps.release.outputs.release_created }}
23+
publish-package:
24+
runs-on: ubuntu-latest
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created }}
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_CONFIG_TOKEN }}
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
2432

25-
- name: Install bun
26-
if: ${{ steps.release.outputs.release_created }}
33+
- name: Setup Bun
2734
uses: oven-sh/setup-bun@v2
35+
with:
36+
bun-version: latest
2837

29-
- name: Install Node
30-
if: ${{ steps.release.outputs.release_created }}
38+
- name: Setup Node.js for npm
3139
uses: actions/setup-node@v4
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_CONFIG_TOKEN }}
3242
with:
33-
node-version: 22
43+
node-version: "latest"
44+
registry-url: "https://registry.npmjs.org"
3445

35-
- name: Install dependencies
36-
if: ${{ steps.release.outputs.release_created }}
37-
run: bun install
46+
- name: 💫 Install dependencies
47+
run: bun i
3848

39-
- name: Build package
40-
if: ${{ steps.release.outputs.release_created }}
49+
- name: 🏡 Build package
4150
run: bun run build
4251

43-
- name: Creating .npmrc
44-
if: ${{ steps.release.outputs.release_created }}
45-
run: |
46-
cat << EOF > "$HOME/.npmrc"
47-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
48-
EOF
49-
env:
50-
NPM_TOKEN: ${{ secrets.NPM_CONFIG_TOKEN }}
51-
52-
- name: Publish package
53-
if: ${{ steps.release.outputs.release_created }}
52+
- name: 🚀 Publish package
5453
run: npm publish --access public

.release-please-config.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prebuild": "rimraf dist",
1717
"build": "bun build ./src/index.ts --outdir ./dist --target node && tsc --emitDeclarationOnly",
1818
"rebuild": "bun run fetch:specs && bun run build",
19-
"publish-package": "bun run build && bun publish --access=public",
19+
"prepublishOnly": "bun run rebuild && bun run test",
2020
"test": "bun test",
2121
"fetch:specs": "bun run ./scripts/fetch-specs.ts && bun run format",
2222
"build:docs": "bun run ./scripts/build-docs.ts",

0 commit comments

Comments
 (0)