Skip to content

Commit 7f744a1

Browse files
committed
Added prebuilt binaries via GitHub Releases
- we're switching away from S3 for hosting binaries in favor of uploading to GitHub Releases straight from CI - this should simplify a lot of things and make it easier to maintain - this commit will upload the binaries generated by Node 16 as a draft Release to GitHub using `node-pre-gyp-github`, which I recently updated - Node 16 should be able to produce v3 and v6 NAPI binaries, and this avoid the race to the finish with other Node versions that we've seen before
1 parent b4b3c3a commit 7f744a1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ jobs:
6363
- name: Package prebuilt binaries
6464
run: yarn node-pre-gyp package
6565

66-
- name: Upload build artifacts
66+
- name: Upload build artifacts to commit artifacts
6767
uses: actions/upload-artifact@v3
6868
if: matrix.node == 16
6969
with:
7070
name: prebuilt-binaries
7171
path: build/stage/sqlite3/*/*
7272
retention-days: 7
73+
74+
- name: Upload binaries to GitHub Release
75+
run: yarn node-pre-gyp-github publish
76+
if: matrix.node == 16 && startsWith(github.ref, 'refs/tags/')
77+
env:
78+
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"binary": {
1111
"module_name": "node_sqlite3",
1212
"module_path": "./lib/binding/napi-v{napi_build_version}-{platform}-{arch}",
13-
"host": "https://mapbox-node-binary.s3.amazonaws.com",
14-
"remote_path": "./{name}/v{version}/{toolset}/",
13+
"host": "https://github.com/TryGhost/node-sqlite3/releases/download/",
14+
"remote_path": "v{version}",
1515
"package_name": "napi-v{napi_build_version}-{platform}-{arch}.tar.gz",
1616
"napi_versions": [
1717
3,
@@ -47,7 +47,8 @@
4747
},
4848
"devDependencies": {
4949
"eslint": "6.8.0",
50-
"mocha": "7.2.0"
50+
"mocha": "7.2.0",
51+
"node-pre-gyp-github": "1.4.4"
5152
},
5253
"peerDependencies": {
5354
"node-gyp": "8.x"

0 commit comments

Comments
 (0)