Skip to content

Add release workflow #1

Add release workflow

Add release workflow #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build release binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: intermesh
asset_name: intermesh-linux-x86_64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: intermesh
asset_name: intermesh-linux-aarch64
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
- name: Strip binary
run: |
strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} || true
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
intermesh-linux-x86_64/intermesh
intermesh-linux-aarch64/intermesh
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}