Skip to content

Workflow file for this run

name: build
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-release:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: macos-14
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --verbose --release --target ${{ matrix.target }}
- name: List builds
shell: pwsh
run: |
Get-ChildItem $(Join-Path -Path $(Get-Location) -ChildPath target -AdditionalChildPath ${{ matrix.target }},release)
- name: Archive artifacts
shell: pwsh
run: |
$isWin = "${{ matrix.os }}".StartsWith("windows-")
Move-Item -Path $($isWin ? ".\target\${{ matrix.target }}\release\als.exe" : "./target/${{ matrix.target }}/release/als") -Destination .
$globArchivePath = $isWin ? "./als.${{ matrix.target }}.zip" : "./als.${{ matrix.target }}.tar.gz"
echo "ARCHIVE_PATH=$globArchivePath" >> $env:GITHUB_ENV
if ($isWin) {
Compress-Archive -Path .\als.exe -DestinationPath .\als.${{ matrix.target }}.zip
} else {
tar -czf ./als.${{ matrix.target }}.tar.gz ./als
}
- name: List archive
shell: pwsh
run: |
Get-ChildItem $(Join-Path -Path $(Get-Location) -ChildPath target -AdditionalChildPath ${{ matrix.target }},release)
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: ${{ env.ARCHIVE_PATH }}