Skip to content

v0.0.2

v0.0.2 #12

Workflow file for this run

name: Build and Release
permissions:
contents: write
on:
release:
types: [created]
jobs:
build:
name: Build and Release Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
- name: Install dependencies (Linux only)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libglib2.0-dev pkg-config
- name: Install dependencies (macOS only)
if: runner.os == 'macOS'
run: brew install glib pkg-config
# Build the project
- name: Build
run: cargo build --release
# Prepare binary for upload per OS
- name: Prepare binary
run: |
BINARY_NAME="cast_viewer"
if [ "${{ runner.os }}" = "Windows" ]; then
mv target/release/${BINARY_NAME}.exe ${BINARY_NAME}-windows.exe
echo "ASSET=${BINARY_NAME}-windows.exe" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "macOS" ]; then
mv target/release/${BINARY_NAME} ${BINARY_NAME}-macos
echo "ASSET=${BINARY_NAME}-macos" >> $GITHUB_ENV
else
mv target/release/${BINARY_NAME} ${BINARY_NAME}-linux
echo "ASSET=${BINARY_NAME}-linux" >> $GITHUB_ENV
fi
shell: bash
# Upload the binary as a release asset
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ASSET }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}