Skip to content

Commit

Permalink
fix: add musl prebuilts (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jun 6, 2021
1 parent 6ee3f4b commit 2fe8d13
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
43 changes: 41 additions & 2 deletions .github/workflows/release-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
node: [12, 14, 15, 16]
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019]
steps:
- name: Checkout Project
uses: actions/checkout@v2
Expand All @@ -25,7 +25,7 @@ jobs:
id: cache-restore
with:
path: node_modules
key: ${{ matrix.os }}-${{ matrix.node_version }}-${{ hashFiles(matrix.os == 'windows-latest' && '**\yarn.lock' || '**/yarn.lock') }}
key: ${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles(matrix.os == 'windows-latest' && '**\yarn.lock' || '**/yarn.lock') }}
- name: Install Dependencies if Cache Miss
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: yarn --frozen-lockfile
Expand All @@ -44,6 +44,45 @@ jobs:
with:
path: 'build/stage/**/*.tar.gz'

PrebuildMusl:
name: Publish Musl Binary
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
matrix:
node: [12, 14, 15, 16]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
apk add --update
apk add --no-cache ca-certificates git curl build-base python3 g++ make
- name: Checkout Project
uses: actions/checkout@v2
- name: Restore CI Cache
uses: actions/[email protected]
id: cache-restore
with:
path: node_modules
key: musl-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies if Cache Miss
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: yarn --frozen-lockfile
- name: Build and package code
run: yarn gyp:prebuild
- name: Store prebuild
uses: actions/upload-artifact@v2
with:
name: prebuilt-musl-${{ matrix.node }}.tar.gz
path: build/stage/**/*.tar.gz
if-no-files-found: error
- name: Publish Binaries
uses: icrawl/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: 'build/stage/**/*.tar.gz'

Crosspost:
name: Release Crosspost
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
},
"binary": {
"module_name": "type",
"module_path": "./prebuild/{module_name}-{node_abi}-{platform}-{arch}-{libc}/",
"module_path": "./prebuild/{module_name}-{node_abi}-{platform}-{arch}-{libc}-{libc_version}/",
"host": "https://github.com/sapphiredev/type/releases/download/",
"remote_path": "v{version}",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}.tar.gz",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}-{libc_version}.tar.gz",
"pkg_path": "."
},
"dependencies": {
Expand Down

0 comments on commit 2fe8d13

Please sign in to comment.