Skip to content

Add release workflows #1

Add release workflows

Add release workflows #1

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
pull_request:
jobs:
build-release:
strategy:
fail-fast: false
matrix:
build: [ linux, macos ]
include:
- build: linux
os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Get tag id
id: get-version-id
uses: iawia002/get-tag-or-commit-id@v1
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --verbose --release
- name: Build archive
shell: bash
run: |
bins=(wackerd wacker)
for name in "${bins[@]}"; do
staging="$name-${{ steps.get-version-id.outputs.id }}-${{ matrix.target }}"
tar czf "$staging.tar.gz" "target/${{ matrix.target }}/release/$name"
echo "$name=$staging.tar.gz" >> $GITHUB_ENV
done
- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.wackerd }}
${{ env.wacker }}