Skip to content

patch: v0.3.4

patch: v0.3.4 #24

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
include:
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- target: aarch64-unknown-linux-gnu
os: ubuntu-20.04
- target: x86_64-unknown-linux-musl
os: ubuntu-20.04
- target: aarch64-unknown-linux-musl
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
override: true
- name: Install arm64 toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'|| matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install musl toolchain
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- uses: Swatinem/rust-cache@v1
- name: Build release version
run: cargo build --verbose --release --target=${{ matrix.target }}
- name: Copy CLI binary
run: |
mkdir dist
cp target/${{ matrix.target }}/release/main ./dist/main-${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: main-${{ matrix.target }}
path: ./dist/main-*
if-no-files-found: error
release:
if: github.event_name != 'pull_request'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: main-*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: main-*
fail_on_unmatched_files: true
generate_release_notes: true