Skip to content

cargo fmt

cargo fmt #10

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-wasi-vfs-cli:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/[email protected]
with:
command: build
args: --release --target=${{ matrix.target }} --package wasi-vfs-cli
use-cross: true
- run: |
zip --junk-paths wasi-vfs-cli-${{ matrix.target }} target/${{ matrix.target }}/release/wasi-vfs{,.exe}
- uses: actions/upload-artifact@v1
with:
name: wasi-vfs-cli-${{ matrix.target }}
path: wasi-vfs-cli-${{ matrix.target }}.zip
build-libwasi-vfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install wasi-sdk
run: |
set -e
wasi_sdk_deb="wasi-sdk_${WASI_SDK_VERSION_MAJOR}.${WASI_SDK_VERSION_MINOR}_amd64.deb"
wget "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/${wasi_sdk_deb}"
sudo dpkg -i "$wasi_sdk_deb"
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
env:
WASI_SDK_VERSION_MAJOR: 20
WASI_SDK_VERSION_MINOR: 0
- uses: actions-rs/[email protected]
with:
command: build
args: --release --target=wasm32-unknown-unknown
- run: |
zip --junk-paths libwasi_vfs-wasm32-unknown-unknown target/wasm32-unknown-unknown/release/libwasi_vfs.a
- uses: actions/upload-artifact@v1
with:
name: libwasi_vfs-wasm32-unknown-unknown
path: libwasi_vfs-wasm32-unknown-unknown.zip
create-release:
needs: [build-wasi-vfs-cli, build-libwasi-vfs]
runs-on: ubuntu-latest
steps:
- id: create-release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v1
with:
name: create-release
path: release_upload_url.txt
upload-cli-release:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- uses: actions/download-artifact@v1
with:
name: wasi-vfs-cli-${{ matrix.target }}
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: ./wasi-vfs-cli-${{ matrix.target }}/wasi-vfs-cli-${{ matrix.target }}.zip
asset_name: wasi-vfs-cli-${{ matrix.target }}.zip
asset_content_type: application/zip
upload-lib-release:
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- uses: actions/download-artifact@v1
with:
name: libwasi_vfs-wasm32-unknown-unknown
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: ./libwasi_vfs-wasm32-unknown-unknown/libwasi_vfs-wasm32-unknown-unknown.zip
asset_name: libwasi_vfs-wasm32-unknown-unknown.zip
asset_content_type: application/zip