Skip to content

Commit c74104b

Browse files
committed
Add Lunte and publish workflow
1 parent bd1b0ee commit c74104b

5 files changed

Lines changed: 94 additions & 35 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Integrate
22
on:
33
push:
44
branches:
@@ -7,6 +7,12 @@ on:
77
branches:
88
- main
99
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
name: Lint
13+
steps:
14+
- uses: holepunchto/actions/node-base@v1
15+
- run: npm run lint
1016
test:
1117
strategy:
1218
matrix:
@@ -21,24 +27,23 @@ jobs:
2127
platform: win32
2228
arch: x64
2329
runs-on: ${{ matrix.os }}
24-
name: ${{ matrix.platform }}-${{ matrix.arch }}
30+
name: Test / ${{ matrix.platform }}-${{ matrix.arch }}
2531
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-node@v4
28-
with:
29-
node-version: lts/*
32+
- uses: holepunchto/actions/bare-base@v1
3033
- run: |
3134
wget https://apt.llvm.org/llvm.sh
3235
chmod +x llvm.sh
33-
sudo ./llvm.sh 20
36+
sudo ./llvm.sh 22
3437
if: ${{ matrix.platform == 'linux' }}
38+
- run: brew install llvm@20
39+
if: ${{ matrix.platform == 'darwin' }}
3540
- run: choco upgrade llvm
3641
if: ${{ matrix.platform == 'win32' }}
3742
- run: choco install nasm
3843
if: ${{ matrix.platform == 'win32' }}
39-
- run: npm install -g bare-runtime bare-make
40-
- run: npm install
41-
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug
42-
- run: bare-make build
43-
- run: bare-make install
44+
- uses: holepunchto/actions/compile-prebuilds@v1
45+
with:
46+
platform: ${{ matrix.platform }}
47+
arch: ${{ matrix.arch }}
48+
flags: --debug
4449
- run: npm test

.github/workflows/prebuild.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,28 @@ jobs:
2525
platform: win32
2626
arch: arm64
2727
runs-on: ${{ matrix.os }}
28-
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
28+
name: Build / ${{ matrix.platform }}-${{ matrix.arch }}
2929
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-node@v4
32-
with:
33-
node-version: lts/*
30+
- uses: holepunchto/actions/bare-base@v1
3431
- run: |
3532
wget https://apt.llvm.org/llvm.sh
3633
chmod +x llvm.sh
37-
sudo ./llvm.sh 20
34+
sudo ./llvm.sh 22
3835
if: ${{ matrix.platform == 'linux' }}
36+
- run: brew install llvm@20
37+
if: ${{ matrix.platform == 'darwin' || matrix.platform == 'ios' }}
3938
- run: choco upgrade llvm
4039
if: ${{ matrix.platform == 'win32' }}
4140
- run: choco install nasm
4241
if: ${{ matrix.platform == 'win32' }}
43-
- run: npm install -g bare-runtime bare-make
44-
- run: npm install
45-
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }}
46-
- run: bare-make build
47-
- run: bare-make install
48-
- uses: actions/upload-artifact@v4
42+
- uses: holepunchto/actions/compile-prebuilds@v1
4943
with:
50-
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
51-
path: prebuilds/*
44+
platform: ${{ matrix.platform }}
45+
arch: ${{ matrix.arch }}
46+
upload: true
5247
merge:
5348
runs-on: ubuntu-latest
5449
needs: prebuild
50+
name: Merge
5551
steps:
56-
- uses: actions/download-artifact@v4
57-
with:
58-
path: prebuilds
59-
merge-multiple: true
60-
- uses: actions/upload-artifact@v4
61-
with:
62-
name: prebuilds
63-
path: prebuilds
52+
- uses: holepunchto/actions/merge-prebuilds@v1

.github/workflows/publish.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
permissions:
7+
id-token: write
8+
contents: write
9+
jobs:
10+
prebuild:
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-22.04
15+
platform: linux
16+
arch: x64
17+
- os: ubuntu-22.04-arm
18+
platform: linux
19+
arch: arm64
20+
- os: macos-14
21+
platform: darwin
22+
arch: x64
23+
- os: macos-14
24+
platform: darwin
25+
arch: arm64
26+
- os: windows-2022
27+
platform: win32
28+
arch: x64
29+
- os: windows-2022
30+
platform: win32
31+
arch: arm64
32+
runs-on: ${{ matrix.os }}
33+
name: Build / ${{ matrix.platform }}-${{ matrix.arch }}
34+
steps:
35+
- uses: holepunchto/actions/bare-base@v1
36+
- run: |
37+
wget https://apt.llvm.org/llvm.sh
38+
chmod +x llvm.sh
39+
sudo ./llvm.sh 22
40+
if: ${{ matrix.platform == 'linux' }}
41+
- run: brew install llvm@20
42+
if: ${{ matrix.platform == 'darwin' || matrix.platform == 'ios' }}
43+
- run: choco upgrade llvm
44+
if: ${{ matrix.platform == 'win32' }}
45+
- run: choco install nasm
46+
if: ${{ matrix.platform == 'win32' }}
47+
- uses: holepunchto/actions/compile-prebuilds@v1
48+
with:
49+
platform: ${{ matrix.platform }}
50+
arch: ${{ matrix.arch }}
51+
upload: true
52+
publish:
53+
runs-on: ubuntu-latest
54+
environment:
55+
name: npm
56+
needs: prebuild
57+
name: Publish
58+
steps:
59+
- uses: holepunchto/actions/node-base@v1
60+
- uses: holepunchto/actions/download-prebuilds@v1
61+
- uses: holepunchto/actions/publish@v1

.lunteignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
"prebuilds"
5858
],
5959
"scripts": {
60-
"test": "prettier . --check && bare test.js",
60+
"format": "prettier --write . && lunte --fix",
61+
"lint": "prettier --check . && lunte",
62+
"test": "brittle-bare --coverage test.js",
6163
"prepack": "node prepack.js"
6264
},
6365
"repository": {
@@ -86,6 +88,7 @@
8688
"cmake-bare": "^1.6.5",
8789
"cmake-bare-bundle": "^3.0.0",
8890
"cmake-fetch": "^1.4.0",
91+
"lunte": "^1.6.0",
8992
"prettier": "^3.4.1",
9093
"prettier-config-holepunch": "^2.0.0"
9194
}

0 commit comments

Comments
 (0)