Skip to content

Build Release Artifacts #29

Build Release Artifacts

Build Release Artifacts #29

Workflow file for this run

name: Build Release Artifacts
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build & package (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
kind: windows
bin: raven.exe
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
kind: unix
bin: raven
- os: macos-latest
target: x86_64-apple-darwin
kind: unix
bin: raven
- os: macos-latest
target: aarch64-apple-darwin
kind: unix
bin: raven
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux build tools
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y pkg-config libgtk-3-dev
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package (Windows)
if: matrix.kind == 'windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force release-artifacts | Out-Null
Compress-Archive "target/${{ matrix.target }}/release/${{ matrix.bin }}" "release-artifacts/raven-${{ matrix.target }}.zip"
- name: Package (Unix)
if: matrix.kind == 'unix'
run: |
mkdir -p release-artifacts
tar -czf "release-artifacts/raven-${{ matrix.target }}.tar.gz" \
-C "target/${{ matrix.target }}/release" "${{ matrix.bin }}"
- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: release-artifacts/*
if-no-files-found: error
release:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
pattern: release-*
path: release-dist
merge-multiple: true
- name: Generate SHA256
run: cd release-dist && sha256sum * > SHA256SUMS.txt
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
files: release-dist/*
generate_release_notes: true