Add musl support (#1072)

This commit is contained in:
강동윤 2020-09-13 18:27:26 +09:00 committed by GitHub
parent 4d5a0dacec
commit 2b12594cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 4 deletions

View File

@ -4,12 +4,11 @@ on:
create: create:
tags: tags:
- v* - v*
# on: [push, pull_request]
env: env:
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
CI: '1' CI: "1"
DEBUG: 'napi:*' DEBUG: "napi:*"
jobs: jobs:
build: build:
@ -64,7 +63,7 @@ jobs:
shell: bash shell: bash
run: npm run build run: npm run build
env: env:
MACOSX_DEPLOYMENT_TARGET: '10.13' MACOSX_DEPLOYMENT_TARGET: "10.13"
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -79,11 +78,48 @@ jobs:
- name: Test bindings - name: Test bindings
run: npm test run: npm test
build_musl:
name: stable - linux-musl - node@12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to registry
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
env:
DOCKER_REGISTRY_URL: docker.pkg.github.com
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image
run: |
docker pull docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts
docker tag docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts builder
- name: "Install dependencies"
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org
- name: "Build"
run: |
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/node-rs -w /node-rs builder sh -c "cargo build -p node --release"
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/node-rs -w /node-rs builder sh -c "./node_modules/.bin/napi build --platform --cargo-name node --musl --release -c ./package.json ./scripts/npm"
- name: List packages
run: ls -R ./scripts/npm/
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: bindings
path: scripts/npm/swc.linux-musl.node
publish: publish:
name: npm name: npm
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build - build
- build_musl
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -0,0 +1,3 @@
`#@swc/core-linux-musl`
this is the **linux** 64-bit musl binary for `@swc/core`

View File

@ -0,0 +1,37 @@
{
"name": "@swc/core-linux-musl",
"version": "1.2.23",
"os": [
"linux"
],
"main": "swc.linux-musl.node",
"files": [
"swc.linux.node"
],
"description": "Super-fast alternative for babel",
"keywords": [
"swc",
"spack",
"babel",
"typescript",
"rust",
"webpack",
"tsc"
],
"author": "강동윤 <kdy1997.dev@gmail.com>",
"homepage": "https://swc-project.github.io",
"license": "MIT",
"cpu": [
"x64"
],
"engines": {
"node": ">=8.9.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/swc-project/swc.git"
},
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
}