Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Publish (Production) #20

Publish (Production)

Publish (Production) #20

Workflow file for this run

# Creates and publishes assets for a new release.
# To manually trigger this workflow, create a release in the GitHub UI.
name: Publish (Production)
on:
push:
tags:
- v*
env:
# hack to get dynlibs working with musl
# https://github.com/rust-lang/rust/pull/55163#issuecomment-436631090
RUSTFLAGS: -C target-feature=-crt-static
NPM_REGISTRY: https://npm.lisk.com
jobs:
publish-github:
runs-on: ${{ matrix.system.os }}
strategy:
fail-fast: false
matrix:
rust_version:
- stable
node_version: [16, 18]
architecture:
- x64
system:
- os: macos-12
target: x86_64-apple-darwin
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
include:
# only node 15+ supports arm64 natively, so we only need to build 16 and 18 for now
- system:
os: [self-hosted, macOS, ARM64]
target: aarch64-apple-darwin
node_version: 16
architecture: arm64
rust_version: stable-aarch64-apple-darwin
- system:
os: [self-hosted, macOS, ARM64]
target: aarch64-apple-darwin
node_version: 18
architecture: arm64
rust_version: stable-aarch64-apple-darwin
steps:
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.config.os == 'windows-latest'
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- name: Install yarn
run: npm install --global yarn
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust_version }}
target: ${{ matrix.system.target }}
override: true
- name: Install modules
run: yarn install --ignore-scripts
- name: Build
id: build
# Use bash, even on Windows.
shell: bash
env:
PRE_GYP_PLATFORM: ${{ matrix.system.pre_gyp_platform }}
PRE_GYP_ARCH: ${{ matrix.system.pre_gyp_arch }}
CARGO_BUILD_TARGET: ${{ matrix.system.target }}
run: |
node publish.js
cd bin-package
echo "::set-output name=asset::$(echo *.tar.gz)"
- name: get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: './package.json'
prop_path: 'version'
- name: Upload release asset
uses: hkusu/s3-upload-action@v2
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: 'eu-west-1'
bucket-root: lisk-db
aws-bucket: ${{ secrets.AWS_BUCKET }}
file-path: bin-package/${{ steps.build.outputs.asset }}
destination-dir: ${{ steps.version.outputs.prop }}