Build and Release versa-wasm #9
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: Build and Release versa-wasm | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-release-wasm: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: x86_64-unknown-freebsd | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
# - os: macos-latest | |
# target: x86_64-apple-darwin | |
# - os: macos-latest | |
# target: aarch64-apple-darwin | |
# - os: windows-latest | |
# target: x86_64-pc-windows-msvc | |
# - os: windows-latest | |
# target: aarch64-pc-windows-msvc | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Install Cross-Compilation Tools for aarch64-linux-musl | |
if: matrix.target == 'aarch64-unknown-linux-musl' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y musl-tools musl-dev gcc-aarch64-linux-gnu | |
echo "CC_aarch64-unknown-linux-musl=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
- name: Install Cross-Compilation Tools for x86_64-linux-musl | |
if: matrix.target == 'x86_64-unknown-linux-musl' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y musl-tools musl-dev gcc-multilib | |
echo "CC_x86_64-unknown-linux-musl=musl-gcc" >> $GITHUB_ENV | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
- name: Build wasm_cli | |
run: | | |
cd crates/wasm_cli | |
cargo build --release --target ${{ matrix.target }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./target/${{ matrix.target }}/release/versa-wasm | |
# - name: Create Release (runs only once) | |
# if: github.event.inputs.tag != 'edge' && matrix.target == 'x86_64-unknown-linux-musl' | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ github.event.inputs.tag }} | |
# release_name: Release ${{ github.event.inputs.tag }} | |
# draft: false | |
# prerelease: false | |
# - name: Upload Release Asset | |
# if: steps.create_release.outputs.upload_url | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: ./target/${{ matrix.target }}/release/versa-wasm | |
# asset_name: versa-wasm-${{ matrix.target }}.tar.gz | |
# asset_content_type: application/octet-stream | |
# run: | | |
# tar -czvf versa-wasm-${{ matrix.target }}.tar.gz -C ./target/${{ matrix.target }}/release versa-wasm |