Release v0.12.0 #11
Workflow file for this run
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
name: Upload prebuilt packages | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
prebuilds: | |
name: Upload binary for (${{ matrix.os }}, ${{ matrix.node }}) | |
strategy: | |
matrix: | |
node: [ "electron", "node" ] | |
os: [ "windows-latest", "macos-latest", "ubuntu-latest" ] | |
# CONTINUE because it can fail for completely irrelevant reason like IO timeout and that would prevent the | |
# whole job from restarting because some part of the packages are already published and would fail anyway | |
continue-on-error: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16.x" | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install LLVM (windows) | |
run: choco install -y llvm | |
if: runner.os == 'Windows' | |
- name: Install system libs (not windows) | |
run: sudo apt-get install libusb-1.0-0-dev libudev-dev | |
if: runner.os == 'Linux' | |
- name: Install build tools (windows) | |
run: choco install -y visualcpp-build-tools | |
if: runner.os == 'Windows' | |
- name: Install JS dependencies | |
run: yarn install | |
- name: Build Rust lib (windows) | |
run: yarn workspace @emeraldpay/emerald-vault-native run build:rs:${{ matrix.node }} | |
if: runner.os == 'Windows' | |
env: | |
# dynamic linkage may be a problem for Windows users who would need to install some extra DLLs just to make Emerald works | |
# so better to link them statically. | |
RUSTFLAGS: "-C target-feature=+crt-static" | |
RUST_BACKTRACE: "1" | |
- name: Build Rust lib (not windows) | |
run: yarn workspace @emeraldpay/emerald-vault-native run build:rs:${{ matrix.node }} | |
if: runner.os != 'Windows' | |
env: | |
RUST_BACKTRACE: "1" | |
# support macOS High Sierra | |
MACOSX_DEPLOYMENT_TARGET: "10.13" | |
- name: Show lib details | |
run: | | |
node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp reveal --directory packages/native | |
ls packages/native/native | |
- name: Build Typescript | |
run: yarn workspaces run build:ts | |
# Cleanup to avoid putting temp files into resulting package | |
- name: Clean Before Package | |
run: yarn workspace @emeraldpay/emerald-vault-native run clean:rs | |
- name: Package | |
run: yarn workspace @emeraldpay/emerald-vault-native run package:${{ matrix.node }} | |
- name: Upload | |
id: upload-release-asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: packages/native/build/stage/*/*.tar.gz | |
file_glob: true |