This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Key length is checked when updating the SMT (#130) #101
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
# Creates and publishes assets for a new release. | |
# To manually trigger this workflow, create a release in the GitHub UI. | |
name: Publish (Canary) | |
on: | |
push: | |
branches: [ main ] | |
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: c-hive/gha-yarn-cache@v1 | |
- uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node_version }} | |
architecture: ${{ matrix.architecture }} | |
- 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 --canary ${{ github.sha }} | |
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' | |
aws-bucket: ${{ secrets.AWS_BUCKET }} | |
bucket-root: lisk-db | |
file-path: bin-package/${{ steps.build.outputs.asset }} | |
destination-dir: ${{ steps.version.outputs.prop }} | |
publish-npm: | |
needs: | |
- publish-github | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: c-hive/gha-yarn-cache@v1 | |
- uses: actions/[email protected] | |
with: | |
node-version: 18 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install modules | |
run: yarn install --ignore-scripts | |
- run: npm config set //npm.lisk.com/:_authToken=$NPM_TOKEN | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish NPM release | |
run: | | |
set -x | |
node publish.js --publish --canary ${{ github.sha }} --registry ${{ env.NPM_REGISTRY }} |