Skip to content

Commit aa69822

Browse files
committed
Update build workflow for new split-generation builds
1 parent 81056d8 commit aa69822

File tree

3 files changed

+132
-98
lines changed

3 files changed

+132
-98
lines changed

.github/workflows/prebuild-test-all.yml

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- run: npm install --ignore-scripts
3232
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
3333
- run: ${{ env.ELECTRON_BUILD_CMD_LEGACY }}
34+
- run: ${{ env.ELECTRON_BUILD_CMD_MODERN }}
3435
- if: matrix.os == 'windows-2022'
3536
run: |
3637
${{ env.NODE_BUILD_CMD_LEGACY }} --arch ia32
@@ -40,81 +41,82 @@ jobs:
4041
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch ia32
4142
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch arm64
4243
43-
prebuild-linux-x64-legacy:
44-
name: Prebuild on Linux x64 (Legacy)
45-
runs-on: ubuntu-latest
46-
container: node:20-bullseye
47-
steps:
48-
- uses: actions/checkout@v4
49-
- run: npm install --ignore-scripts
50-
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
51-
- run: ${{ env.ELECTRON_BUILD_CMD_LEGACY }}
52-
53-
prebuild-linux-x64-modern:
54-
name: Prebuild on Linux x64 (Modern)
55-
runs-on: ubuntu-latest
56-
container: node:20-bookworm
57-
steps:
58-
- uses: actions/checkout@v4
59-
- run: npm install --ignore-scripts
60-
- run: ${{ env.ELECTRON_BUILD_CMD_MODERN }}
61-
62-
prebuild-alpine-linux:
63-
name: Prebuild on Alpine-Linux (x64)
64-
runs-on: ubuntu-latest
65-
container: node:20-alpine
44+
prebuild-linux:
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
os:
49+
- ubuntu-latest
50+
- ubuntu-24.04-arm
51+
image:
52+
- node:20-bullseye
53+
- node:20-bookworm
54+
include:
55+
- image: node:20-bullseye
56+
generation: legacy
57+
- image: node:20-bookworm
58+
generation: modern
59+
- os: ubuntu-latest
60+
arch: x64
61+
- os: ubuntu-24.04-arm
62+
arch: arm64
63+
name: Prebuild on Linux ${{ matrix.arch }} (${{ matrix.generation }})
64+
runs-on: ${{ matrix.os }}
65+
container: ${{ matrix.image }}
6666
steps:
6767
- uses: actions/checkout@v4
68-
- run: apk add build-base git python3 py3-setuptools --update-cache
6968
- run: npm install --ignore-scripts
70-
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
71-
72-
prebuild-alpine-linux-arm64:
73-
name: Prebuild on Alpine-Linux (arm64)
74-
runs-on: ubuntu-latest
75-
steps:
76-
- uses: actions/checkout@v4
77-
- uses: docker/setup-qemu-action@v3
78-
- run: |
79-
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/arm64 node:20-alpine -c "\
80-
apk add build-base git python3 py3-setuptools --update-cache && \
81-
cd /tmp/project && \
82-
npm install --ignore-scripts && \
83-
${{ env.NODE_BUILD_CMD_LEGACY }}"
69+
- if: matrix.generation == 'legacy'
70+
run: |
71+
${{ env.NODE_BUILD_CMD_LEGACY }}
72+
${{ env.ELECTRON_BUILD_CMD_LEGACY }}
73+
- if: matrix.generation == 'modern'
74+
run: |
75+
${{ env.ELECTRON_BUILD_CMD_MODERN }}
8476
85-
prebuild-linux-arm-legacy:
77+
prebuild-linux-armv7:
8678
strategy:
8779
fail-fast: false
8880
matrix:
89-
arch:
90-
- arm/v7
91-
- arm64
92-
name: Prebuild on Linux (${{ matrix.arch }}) (Legacy)
81+
image:
82+
- node:20-bullseye
83+
- node:20-bookworm
84+
include:
85+
- image: node:20-bullseye
86+
generation: legacy
87+
- image: node:20-bookworm
88+
generation: modern
89+
name: Prebuild on Linux armv7 (${{ matrix.generation }})
9390
runs-on: ubuntu-latest
9491
steps:
9592
- uses: actions/checkout@v4
9693
- uses: docker/setup-qemu-action@v3
97-
- run: |
98-
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-bullseye -c "\
94+
- if: matrix.generation == 'legacy'
95+
run: |
96+
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/arm/v7 ${{ matrix.image }} -c "\
9997
cd /tmp/project && \
10098
npm install --ignore-scripts && \
101-
${{ env.NODE_BUILD_CMD_LEGACY }} && \
102-
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch arm64; fi"
99+
${{ env.NODE_BUILD_CMD_LEGACY }}"
103100
104-
prebuild-linux-arm-modern:
101+
prebuild-alpine-linux:
105102
strategy:
106103
fail-fast: false
107104
matrix:
108-
arch:
109-
- arm/v7
110-
- arm64
111-
name: Prebuild on Linux (${{ matrix.arch }}) (Modern)
112-
runs-on: ubuntu-latest
105+
os:
106+
- ubuntu-latest
107+
- ubuntu-24.04-arm
108+
include:
109+
- os: ubuntu-latest
110+
arch: x64
111+
- os: ubuntu-24.04-arm
112+
arch: arm64
113+
name: Prebuild on Alpine-Linux (${{ matrix.arch }})
114+
runs-on: ${{ matrix.os }}
113115
steps:
114116
- uses: actions/checkout@v4
115-
- uses: docker/setup-qemu-action@v3
116117
- run: |
117-
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-bookworm -c "\
118+
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh node:20-alpine -c "\
119+
apk add build-base git python3 py3-setuptools --update-cache && \
118120
cd /tmp/project && \
119121
npm install --ignore-scripts && \
120-
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch arm64; fi"
122+
${{ env.NODE_BUILD_CMD_LEGACY }}"

.github/workflows/prebuild-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
targets:
1717
description: 'Runtime versions (targets)'
1818
required: true
19-
default: -t 18.0.0
19+
default: -t 24.0.0
2020
ubuntu-22.04:
2121
description: 'Test on ubuntu-22.04'
2222
type: boolean
@@ -90,7 +90,7 @@ jobs:
9090

9191
prebuild-test-mac-arm64:
9292
if: inputs.macos-15-intel == true && inputs.arm == true
93-
name: Testing prebuild on M1 macOS (arm64)
93+
name: Testing prebuild on macOS (arm64)
9494
runs-on: macos-15
9595
steps:
9696
- uses: actions/checkout@v4

.github/workflows/prebuild.yml

Lines changed: 72 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ on:
66
- published
77

88
env:
9-
NODE_BUILD_CMD: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
10-
ELECTRON_BUILD_CMD: npx --no-install prebuild -r electron -t 29.0.0 -t 30.0.0 -t 31.0.0 -t 32.0.0 -t 33.0.0 -t 34.0.0 -t 35.0.0 -t 36.0.0 -t 37.0.0 -t 38.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
9+
NODE_BUILD_CMD_LEGACY: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
10+
ELECTRON_BUILD_CMD_LEGACY: npx --no-install prebuild -r electron -t 29.0.0 -t 30.0.0 -t 31.0.0 -t 32.0.0 -t 33.0.0 -t 34.0.0 -t 35.0.0 -t 36.0.0 -t 37.0.0 -t 38.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
11+
ELECTRON_BUILD_CMD_MODERN: npx --no-install prebuild -r electron -t 39.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
1112

1213
jobs:
1314
prebuild:
@@ -30,63 +31,94 @@ jobs:
3031
- if: ${{ startsWith(matrix.os, 'macos') }}
3132
run: brew install python-setuptools
3233
- run: npm install --ignore-scripts
33-
- run: ${{ env.NODE_BUILD_CMD }}
34-
- run: ${{ env.ELECTRON_BUILD_CMD }}
34+
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
35+
- run: ${{ env.ELECTRON_BUILD_CMD_LEGACY }}
36+
- run: ${{ env.ELECTRON_BUILD_CMD_MODERN }}
3537
- if: matrix.os == 'windows-2022'
3638
run: |
37-
${{ env.NODE_BUILD_CMD }} --arch ia32
38-
${{ env.NODE_BUILD_CMD }} --arch arm64
39-
${{ env.ELECTRON_BUILD_CMD }} --arch ia32
40-
${{ env.ELECTRON_BUILD_CMD }} --arch arm64
39+
${{ env.NODE_BUILD_CMD_LEGACY }} --arch ia32
40+
${{ env.NODE_BUILD_CMD_LEGACY }} --arch arm64
41+
${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch ia32
42+
${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch arm64
43+
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch ia32
44+
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch arm64
4145
42-
prebuild-linux-x64:
43-
name: Prebuild on Linux x64
44-
runs-on: ubuntu-latest
45-
container: node:20-bullseye
46-
steps:
47-
- uses: actions/checkout@v4
48-
- run: npm install --ignore-scripts
49-
- run: ${{ env.NODE_BUILD_CMD }}
50-
- run: ${{ env.ELECTRON_BUILD_CMD }}
51-
52-
prebuild-alpine-linux:
53-
name: Prebuild on Alpine-Linux (x64)
54-
runs-on: ubuntu-latest
55-
container: node:20-alpine
46+
prebuild-linux:
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os:
51+
- ubuntu-latest
52+
- ubuntu-24.04-arm
53+
image:
54+
- node:20-bullseye
55+
- node:20-bookworm
56+
include:
57+
- image: node:20-bullseye
58+
generation: legacy
59+
- image: node:20-bookworm
60+
generation: modern
61+
- os: ubuntu-latest
62+
arch: x64
63+
- os: ubuntu-24.04-arm
64+
arch: arm64
65+
name: Prebuild on Linux ${{ matrix.arch }} (${{ matrix.generation }})
66+
runs-on: ${{ matrix.os }}
67+
container: ${{ matrix.image }}
5668
steps:
5769
- uses: actions/checkout@v4
58-
- run: apk add build-base git python3 py3-setuptools --update-cache
5970
- run: npm install --ignore-scripts
60-
- run: ${{ env.NODE_BUILD_CMD }}
71+
- if: matrix.generation == 'legacy'
72+
run: |
73+
${{ env.NODE_BUILD_CMD_LEGACY }}
74+
${{ env.ELECTRON_BUILD_CMD_LEGACY }}
75+
- if: matrix.generation == 'modern'
76+
run: |
77+
${{ env.ELECTRON_BUILD_CMD_MODERN }}
6178
62-
prebuild-alpine-linux-arm64:
63-
name: Prebuild on Alpine-Linux (arm64)
79+
prebuild-linux-armv7:
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
image:
84+
- node:20-bullseye
85+
- node:20-bookworm
86+
include:
87+
- image: node:20-bullseye
88+
generation: legacy
89+
- image: node:20-bookworm
90+
generation: modern
91+
name: Prebuild on Linux armv7 (${{ matrix.generation }})
6492
runs-on: ubuntu-latest
6593
steps:
6694
- uses: actions/checkout@v4
6795
- uses: docker/setup-qemu-action@v3
68-
- run: |
69-
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/arm64 node:20-alpine -c "\
70-
apk add build-base git python3 py3-setuptools --update-cache && \
96+
- if: matrix.generation == 'legacy'
97+
run: |
98+
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/arm/v7 ${{ matrix.image }} -c "\
7199
cd /tmp/project && \
72100
npm install --ignore-scripts && \
73-
${{ env.NODE_BUILD_CMD }}"
101+
${{ env.NODE_BUILD_CMD_LEGACY }}"
74102
75-
prebuild-linux-arm:
103+
prebuild-alpine-linux:
76104
strategy:
77105
fail-fast: false
78106
matrix:
79-
arch:
80-
- arm/v7
81-
- arm64
82-
name: Prebuild on Linux (${{ matrix.arch }})
83-
runs-on: ubuntu-latest
107+
os:
108+
- ubuntu-latest
109+
- ubuntu-24.04-arm
110+
include:
111+
- os: ubuntu-latest
112+
arch: x64
113+
- os: ubuntu-24.04-arm
114+
arch: arm64
115+
name: Prebuild on Alpine-Linux (${{ matrix.arch }})
116+
runs-on: ${{ matrix.os }}
84117
steps:
85118
- uses: actions/checkout@v4
86-
- uses: docker/setup-qemu-action@v3
87119
- run: |
88-
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-bullseye -c "\
120+
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh node:20-alpine -c "\
121+
apk add build-base git python3 py3-setuptools --update-cache && \
89122
cd /tmp/project && \
90123
npm install --ignore-scripts && \
91-
${{ env.NODE_BUILD_CMD }} && \
92-
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD }} --arch arm64; fi"
124+
${{ env.NODE_BUILD_CMD_LEGACY }}"

0 commit comments

Comments
 (0)