-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add github actions for prebuilding #459
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d0d6d8
chore: add github actions for prebuilding
aminya c8797b3
chore: add default value for sanitizers variable
aminya d8aaa0c
chore: convert the prebuild script to typescript
aminya a8b8a8a
chore: add windows x86 build support
aminya d8fccb2
chore: remove vendor related code from dev:build script
aminya 7578890
chore: only set DCMAKE_GENERATOR_PLATFORM if x86
aminya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
Build: | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- macos-latest | ||
- windows-latest | ||
node_version: | ||
- 14 | ||
node_arch: | ||
- x64 | ||
include: | ||
- os: windows-latest | ||
node_version: 14 | ||
node_arch: x86 | ||
# - os: macos-11.0 | ||
# node_version: 15 | ||
# node_arch: arm64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
architecture: ${{ matrix.node_arch }} | ||
|
||
- name: Install Dependencies and Build | ||
run: npm install | ||
|
||
- name: Prebuild | ||
run: npm run prebuild | ||
env: | ||
ARCH: ${{ matrix.node_arch }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./prebuilds | ||
|
||
Skip: | ||
if: contains(github.event.head_commit.message, '[skip ci]') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Skip CI 🚫 | ||
run: echo skip ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* eslint-disable @typescript-eslint/camelcase */ | ||
|
||
import {spawnSync} from "child_process" | ||
|
||
main().catch(e => { | ||
throw e | ||
}) | ||
|
||
async function main() { | ||
console.log("Building distribution binary...") | ||
|
||
const prebuildArch = getNodearch(process.env.ARCH) | ||
|
||
if (process.env.TRIPLE) { | ||
const TRIPLE = process.env.TRIPLE | ||
|
||
const GCC = process.env.GCC | ||
process.env.CC = `${TRIPLE}-gcc-${GCC}` | ||
process.env.CXX = `${TRIPLE}-g++-${GCC}` | ||
|
||
const STRIP = `${TRIPLE}-strip` | ||
process.env.PREBUILD_STRIP_BIN = STRIP | ||
|
||
process.env.npm_config_arch = prebuildArch | ||
process.env.npm_config_target_arch = prebuildArch | ||
process.env.PREBUILD_arch = prebuildArch | ||
|
||
process.env.ZMQ_BUILD_OPTIONS = `--host=${TRIPLE}` | ||
} | ||
|
||
let prebuildScript = `prebuildify --napi --arch=${prebuildArch} -t 12.0.0 -t electron@9.4.4 --strip` | ||
|
||
if (process.platform == "linux") { | ||
prebuildScript = `${prebuildScript} --tag-libc` | ||
} | ||
if (process.env.ALPINE_CHROOT) { | ||
prebuildScript = `/alpine/enter-chroot ${prebuildScript}` | ||
} | ||
|
||
spawnSync(prebuildScript, { | ||
shell: true, | ||
stdio: "inherit", | ||
encoding: "utf8", | ||
}) | ||
} | ||
|
||
function getNodearch(arch: string | undefined): string { | ||
if (!arch) { | ||
return process.arch | ||
} | ||
if (arch === "x86") { | ||
return "ia32" | ||
} else { | ||
return arch | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be enough