Skip to content

v1.0.0 initial release #1

v1.0.0 initial release

v1.0.0 initial release #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-latest
asset_name: dstimer-macos-x86_64
- target: aarch64-apple-darwin
runner: macos-latest
asset_name: dstimer-macos-aarch64
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
asset_name: dstimer-linux-x86_64
- target: aarch64-unknown-linux-gnu
runner: ubuntu-latest
asset_name: dstimer-linux-aarch64
use_cross: true
- target: x86_64-pc-windows-msvc
runner: windows-latest
asset_name: dstimer-windows-x86_64.exe
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install ALSA dev libraries (Linux x86_64)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev pkg-config
- name: Install cross (Linux aarch64)
if: matrix.use_cross == true
uses: taiki-e/install-action@cross
- name: Build (cross)
if: matrix.use_cross == true
run: cross build --release --target ${{ matrix.target }}
- name: Build (cargo)
if: matrix.use_cross != true
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary (Unix)
if: matrix.runner != 'windows-latest'
run: cp target/${{ matrix.target }}/release/dstimer ${{ matrix.asset_name }}
- name: Rename binary (Windows)
if: matrix.runner == 'windows-latest'
run: cp target/${{ matrix.target }}/release/dstimer.exe ${{ matrix.asset_name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create release and upload assets
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true