Skip to content

Commit 802f27f

Browse files
committed
v4.0.0
1 parent 15cddc2 commit 802f27f

2 files changed

Lines changed: 33 additions & 39 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
1+
# .github/workflows/build.yml
32

4-
name: Build
3+
name: Build and Test
54

65
on: ["push", "pull_request"]
76

87
jobs:
98
test-node:
9+
name: Test on Node.js ${{ matrix.node-version }}
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [18.x, 20.x, 22.x] # Node 24 is not an LTS version yet, can be added later if needed.
13+
node-version: [18.x, 20.x, 22.x]
14+
1415
steps:
1516
- name: Checkout repository
1617
uses: actions/checkout@v4
@@ -19,6 +20,7 @@ jobs:
1920
uses: actions/setup-node@v4
2021
with:
2122
node-version: ${{ matrix.node-version }}
23+
cache: 'npm' # Add caching for npm dependencies
2224

2325
- name: Install dependencies
2426
run: npm install
@@ -43,18 +45,21 @@ jobs:
4345
if: matrix.node-version == '22.x'
4446
uses: codecov/codecov-action@v4
4547
with:
46-
token: ${{ secrets.CODECOV_TOKEN }} # It's recommended to use a repository upload token
47-
48+
token: ${{ secrets.CODECOV_TOKEN }}
4849

49-
# --- New Job for Bun ---
50+
# --- Test on the Bun runtime ---
5051
test-bun:
52+
name: Test on Bun
5153
runs-on: ubuntu-latest
5254
steps:
5355
- name: Checkout repository
5456
uses: actions/checkout@v4
5557

5658
- name: Set up Bun
5759
uses: oven-sh/setup-bun@v1
60+
with:
61+
bun-version: latest # Or a specific version
62+
# Caching is enabled by default with setup-bun
5863

5964
- name: Install dependencies
6065
run: bun install

.github/workflows/npm-publish.yml

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
4-
name: Node.js Package
1+
name: Publish Node.js Package
52

63
on:
74
release:
85
types: [created]
96

107
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
node-version: [18.x, 20.x, 22.x, 22.x]
16-
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
19-
with:
20-
node-version: ${{ matrix.node-version }}
21-
- run: npm i
22-
- run: npm run build
23-
- run: npm run test
24-
- run: npm run coverage
25-
- uses: coverallsapp/github-action@main
26-
with:
27-
github-token: ${{ secrets.GITHUB_TOKEN }}
28-
- uses: codecov/codecov-action@v1
29-
308
publish-npm:
31-
needs: build
9+
name: Publish to npm Registry
3210
runs-on: ubuntu-latest
3311
steps:
34-
- uses: actions/checkout@v2
35-
- uses: actions/setup-node@v2
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
3617
with:
37-
node-version: 16
38-
registry-url: https://registry.npmjs.org/
39-
- run: npm i
40-
- run: npm run build
41-
- run: npm publish
18+
node-version: 22.x
19+
registry-url: 'https://registry.npmjs.org/'
20+
cache: 'npm'
21+
22+
- name: Install dependencies cleanly
23+
run: npm ci
24+
25+
- name: Run build
26+
run: npm run build
27+
28+
- name: Publish package to npm
29+
if: github.repository_owner == 'brahma-dev'
30+
run: npm publish --access public
4231
env:
43-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)