Skip to content

Release Binaries

Release Binaries #14

Workflow file for this run

name: Release Binaries
on:
release:
types: [published]
permissions:
contents: write # Required for uploading release assets
jobs:
build:
name: Build binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
ext: ""
name: linux-x86_64
- os: macos-latest
target: x86_64-apple-darwin
ext: ""
name: macos-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: ".exe"
name: windows-x86_64
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Package Linux Binary
if: runner.os == 'Linux'
run: |
cp target/release/aether-renderer-core .
zip aether-renderer-core-${{ github.ref_name }}-linux-x86_64.zip aether-renderer-core
- name: Package macOS Binary
if: runner.os == 'macOS'
run: |
cp target/release/aether-renderer-core .
zip aether-renderer-core-${{ github.ref_name }}-macos-x86_64.zip aether-renderer-core
- name: Package Windows Binary
if: runner.os == 'Windows'
run: |
cp target/release/aether-renderer-core.exe .
7z a aether-renderer-core-${{ github.ref_name }}-windows-x86_64.zip aether-renderer-core.exe
- name: Rename binary
shell: bash
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/aether-renderer-core${{ matrix.ext }} \
dist/aether-renderer-core-${{ github.ref_name }}-${{ matrix.name }}${{ matrix.ext }}
- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}