Skip to content

Workflow file for this run

name: build
on:
push:
branches: ["main", "gh-build"]
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: ubuntu-22.04
target: aarch64-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 }}
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-Location
Get-ChildItem $(Join-Path -Path $(Get-Location) -ChildPath target -AdditionalChildPath ${{ matrix.target }},release)
- name: Archive artifacts
shell: pwsh
run: |
$os = "${{ matrix.os }}"
$isWin = $os.StartsWith("windows-")
$binaryName = $isWin ? "als.exe" : "als"
$archiveName = $isWin ? "als.zip" : "als.tar.gz"
$releaseFolder = Join-Path $(Get-Location) -ChildPath target -AdditionalChildPath ${{ matrix.target }},release
$binaryPath = Join-Path -Path $releaseFolder -ChildPath $binaryName
$archivePath = Join-Path -Path $releaseFolder -ChildPath $archiveName
echo "ARCHIVE_PATH=$archivePath" >> $env:GITHUB_ENV
if ($isWin) {
Compress-Archive -Path $binaryPath -DestinationPath $archivePath
} else {
tar czf $archivePath $binaryPath
}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: ${{ env.ARCHIVE_PATH }}