Release CI #72
Workflow file for this run
This file contains hidden or 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: Release CI | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: linux-x86_64 | |
suffix: '' | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: linux-aarch64 | |
suffix: '' | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
name: macos | |
suffix: '' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- uses: actions-rs/toolchain@v1.0.7 | |
with: | |
profile: minimal | |
toolchain: nightly-2023-05-05 | |
override: true | |
- name: Install system dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends libclang-dev cmake | |
- name: Install cross-compilation tools | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
rustup target add aarch64-unknown-linux-gnu | |
- name: Add WASM target | |
run: rustup target add wasm32-unknown-unknown | |
- uses: actions/cache@v4.2.3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions/cache@v4.2.3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions/cache@v4.2.3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/cargo@v1.0.3 | |
with: | |
command: build | |
args: '--release --target ${{ matrix.target }}' | |
env: | |
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc | |
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ | |
AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar | |
- name: Package | |
shell: bash | |
run: | | |
cd target/${{ matrix.target }}/release | |
tar czvf ../../../poscan-consensus-${{ matrix.name }}.tar.gz poscan-consensus${{ matrix.suffix }} | |
cd - | |
- name: Package WASM Artifact | |
if: matrix.name == 'linux-x86_64' | |
run: | | |
cd target/${{ matrix.target }}/release/wbuild/poscan-runtime | |
tar czvf ../../../../../poscan_runtime-wasm32-unknown-unknown.tar.gz poscan_runtime.compact.compressed.wasm | |
- name: Publish | |
uses: softprops/action-gh-release@v2.2.2 | |
with: | |
files: | | |
poscan-consensus-* | |
poscan_runtime-* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |