redirect canister snapshot calls (#63) #28
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: Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Build for ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
name: linux64 | |
artifact_name: target/release/ic-wasm | |
asset_name: ic-wasm-linux64 | |
- os: macos-12 | |
name: macos | |
artifact_name: target/release/ic-wasm | |
asset_name: ic-wasm-macos | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Build | |
run: cargo build --release --locked | |
- name: 'Upload assets' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.asset_name }} | |
path: ${{ matrix.artifact_name }} | |
retention-days: 3 | |
test: | |
needs: build | |
name: Test for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
asset_name: ic-wasm-linux64 | |
- os: ubuntu-20.04 | |
asset_name: ic-wasm-linux64 | |
- os: macos-13 | |
asset_name: ic-wasm-macos | |
- os: macos-12 | |
asset_name: ic-wasm-macos | |
steps: | |
- name: Get executable | |
id: download | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.asset_name }} | |
- name: Executable runs | |
run: | | |
chmod +x ic-wasm | |
./ic-wasm --version | |
publish: | |
needs: test | |
name: Publish ${{ matrix.asset_name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Note: | |
# - `asset_name` is the traditional name for these releases. It is simple to understand and keeping it preserves backwards compatibility. | |
# - `binstall_name` is the name used by `cargo binstall`. `binstall` installs a binary, if available for the given target, else builds from source. | |
# Building from source is time-consuming, hence the preference for `cargo binstall` over `cargo install` that always builds from source. | |
- asset_name: ic-wasm-linux64 | |
binstall_name: ic-wasm-x86_64-unknown-linux-gnu.tar.gz | |
- asset_name: ic-wasm-macos | |
binstall_name: ic-wasm-x86_64-apple-darwin.tar.gz | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get executable | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.asset_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ic-wasm | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
- name: Bundle for binstall | |
run: | | |
chmod +x ic-wasm | |
tar -cvzf ${{ matrix.binstall_name }} ic-wasm | |
- name: Upload binstall binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ matrix.binstall_name }} | |
asset_name: ${{ matrix.binstall_name }} | |
tag: ${{ github.ref }} |