@@ -15,10 +15,6 @@ concurrency:
1515jobs :
1616 build :
1717 runs-on : ${{ matrix.os }}
18- permissions :
19- contents : write
20- packages : write
21- id-token : write
2218 strategy :
2319 fail-fast : false
2420 matrix :
6157
6258 name : ${{ matrix.os }} (host=${{ matrix.host }}, target=${{ matrix.target }})
6359 steps :
64- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
60+ - uses : actions/checkout@v4
6561 - uses : actions/setup-node@v4
6662 with :
6763 node-version : ${{ matrix.node }}
@@ -102,41 +98,29 @@ jobs:
10298 echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
10399
104100 - name : Build binaries
105- run : yarn prebuild -a ${{ env.TARGET }}
101+ run : yarn prebuild --arch ${{ env.TARGET }} --tag-libc
106102
107103 - name : Print binary info
108104 if : contains(matrix.os, 'ubuntu')
109105 run : |
110- ldd build/**/node_sqlite3 .node
106+ ldd prebuilds/*/* .node
111107 echo "---"
112- nm build/**/node_sqlite3 .node | grep "GLIBC_" | c++filt || true
108+ nm prebuilds/*/* .node | grep "GLIBC_" | c++filt || true
113109 echo "---"
114- file build/**/node_sqlite3 .node
110+ file prebuilds/*/* .node
115111
116112 - name : Run tests
117113 run : yarn test
118114
119- - name : Upload binaries to commit artifacts
115+ - name : Upload prebuilds to artifacts
120116 uses : actions/upload-artifact@v4
121- if : matrix.node == 24 && matrix.os == 'ubuntu-22.04'
122117 with :
123- name : prebuilt-binaries
124- path : prebuilds/*
118+ name : prebuilds-${{ matrix.os }}-${{ matrix.host }}-${{ matrix.target }}-${{ matrix.node }}
119+ path : prebuilds/
125120 retention-days : 7
126121
127- - name : Upload binaries to GitHub Release
128- run : yarn upload --upload-all ${{ github.token }}
129- if : startsWith(github.ref, 'refs/tags/')
130- - name : Publish
131- run : |
132- npm publish --provenance --access=public
133- if : matrix.node == 24 && matrix.os == 'ubuntu-22.04' && startsWith(github.ref, 'refs/tags/')
134122 build-qemu :
135123 runs-on : ubuntu-24.04-arm
136- permissions :
137- contents : write
138- packages : write
139- id-token : write
140124 strategy :
141125 fail-fast : false
142126 matrix :
@@ -159,7 +143,7 @@ jobs:
159143 node : 22
160144 name : ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
161145 steps :
162- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
146+ - uses : actions/checkout@v4
163147
164148 - name : Set up QEMU
165149 uses : docker/setup-qemu-action@v3
@@ -180,7 +164,47 @@ jobs:
180164 .
181165 CONTAINER_ID=$(docker create -it sqlite-builder)
182166 docker cp $CONTAINER_ID:/usr/src/build/prebuilds/ ./prebuilds
167+ - name : Sanitize target name for Artifact
168+ run : |
169+ SAFE_TARGET=$(echo "${{ matrix.target }}" | tr '/' '-')
170+ echo "SAFE_TARGET=$SAFE_TARGET" >> $GITHUB_ENV
171+ - name : Upload QEMU prebuilds to artifacts
172+ uses : actions/upload-artifact@v4
173+ with :
174+ name : prebuilds-qemu-${{ matrix.variant }}-${{ env.SAFE_TARGET }}-${{ matrix.node }}
175+ path : prebuilds/
176+ retention-days : 7
177+
178+ publish :
179+ needs : [build, build-qemu]
180+ runs-on : ubuntu-22.04
181+ permissions :
182+ contents : write
183+ packages : write
184+ id-token : write
185+ steps :
186+ - uses : actions/checkout@v4
187+
188+ - uses : actions/setup-node@v4
189+ with :
190+ node-version : 24
191+ scope : ' @appthreat'
192+
193+ - name : Download and merge all prebuilds
194+ uses : actions/download-artifact@v4
195+ with :
196+ pattern : prebuilds-*
197+ path : prebuilds/
198+ merge-multiple : true
199+
200+ - name : Add yarn
201+ run : npm install -g yarn
202+
203+ - name : Install dependencies
204+ run : |
205+ yarn install --ignore-scripts
206+ npm publish --dry-run
183207
184- - name : Upload binaries to GitHub Release
185- run : yarn install --ignore-scripts && yarn upload --upload-all ${{ github.token }}
208+ - name : Publish to npm
209+ run : npm publish --provenance --access=public
186210 if : startsWith(github.ref, 'refs/tags/')
0 commit comments