Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
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 }} | |
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: | | |
$isWin = "${{ matrix.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: List archive | |
shell: pwsh | |
run: | | |
Get-Location | |
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 }} |