Skip to content

Update github workflow image to bypass apt install fail issue #59

Update github workflow image to bypass apt install fail issue

Update github workflow image to bypass apt install fail issue #59

Workflow file for this run

name: release
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
tags:
- 'v[0-9]+.[0-9]+.*'
pull_request:
branches: [main]
jobs:
build:
name: Build on ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
runner: arm64
- arch: x86_64
runner: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: Setup WasmEdge build env
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.11.2 --platform=${{ runner.os }} --machine=${{ matrix.arch }}
echo "LD_LIBRARY_PATH=$HOME/.wasmedge/lib" >> $GITHUB_ENV
- name: Install deps on arm64
run: |
sudo apt update
sudo apt install -y clang llvm
- name: Install nightly Rust Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
- name: Build
run: |
cargo build --features wasmedge --verbose --release
- name: package assets
run: |
mkdir _dist
cp target/release/containerd-shim-wasmedge-v1 _dist/containerd-shim-wasmedge-v1
cd _dist
tar czf containerd-shim-wasmedge-v1-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz containerd-shim-wasmedge-v1
- name: upload binary as GitHub artifact
uses: actions/upload-artifact@v3
with:
name: containerd-shim-wasmedge-v1-${{ matrix.arch }}
path: _dist/containerd-shim-wasmedge-v1-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz
- name: Test
run: |
cargo test --features wasmedge --verbose
release:
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
runner: arm64
- arch: x86_64
runner: ubuntu-latest
steps:
- name: Set RELEASE_VERSION ENV var
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: containerd-shim-wasmedge-v1-${{ matrix.arch }}
- name: Apply version
run: mv containerd-shim-wasmedge-v1-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz containerd-shim-wasmedge-v1-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz
- name: upload binary to GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: containerd-shim-wasmedge-v1-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz
asset_name: containerd-shim-wasmedge-v1-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.arch }}.tar.gz
overwrite: true
prerelease: true
tag: ${{ github.ref }}
body: |
Release of containerd-shim-wasmedge-v1:${{ env.RELEASE_VERSION }} for x86_64 and arm64