Skip to content

Release

Release #3

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'The tag name to attach these binaries to (e.g., v0.1.1)'
required: true
type: string
permissions:
contents: write
jobs:
build-release:
name: Build & Publish Release Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: graphyn
asset_name: graphyn-x86_64-unknown-linux-gnu.tar.gz
- os: macos-13
target: x86_64-apple-darwin
artifact_name: graphyn
asset_name: graphyn-x86_64-apple-darwin.tar.gz
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: graphyn
asset_name: graphyn-aarch64-apple-darwin.tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: graphyn.exe
asset_name: graphyn-x86_64-pc-windows-msvc.zip
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Install gcc-13 (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-13 g++-13
- name: Set CC/CXX (Linux)
if: runner.os == 'Linux'
run: |
echo "CC=gcc-13" >> $GITHUB_ENV
echo "CXX=g++-13" >> $GITHUB_ENV
- name: Set LIBCLANG_PATH (Windows)
if: runner.os == 'Windows'
run: echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $env:GITHUB_ENV
- name: Build Binary
run: cargo build --locked --release -p graphyn-cli --target ${{ matrix.target }}
- name: Package Release (Linux/macOS)
if: runner.os != 'Windows'
run: |
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} .
tar -czf ${{ matrix.asset_name }} ${{ matrix.artifact_name }} README.md LICENSE
- name: Package Release (Windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path target\${{ matrix.target }}\release\${{ matrix.artifact_name }}, README.md, LICENSE -DestinationPath ${{ matrix.asset_name }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
files: ${{ matrix.asset_name }}
fail_on_unmatched_files: true
generate_release_notes: true