Skip to content

fix: version bump

fix: version bump #25

Workflow file for this run

name: Build and upload binaries to release
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
release:
name: Publish for ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: target/release/stoic-quotes
asset_name: linux-amd64
target: "false"
- os: ubuntu-latest
artifact_name: target/aarch64-unknown-linux-gnu/release/stoic-quotes
asset_name: linux-aarch64
target: aarch64-unknown-linux-gnu
- os: macos-latest
artifact_name: target/release/stoic-quotes
asset_name: macos-amd64
target: "false"
- os: macos-latest
artifact_name: target/aarch64-apple-darwin/release/stoic-quotes
asset_name: macos-aarch64
target: aarch64-apple-darwin
steps:
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
- name: Set-up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Linux aarch64 deps
run: |
if [ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]; then
sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
mkdir -p .cargo
echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml
echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml
fi
- name: Build project
run: |
# hack for aarch64
FLAGS=""
if [ "${{ matrix.target }}" != "false" ]; then
FLAGS="--target=${{ matrix.target }}"
rustup target add "${{ matrix.target }}"
fi
cargo build --release $FLAGS
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
asset_name: stoic-quotes-${{ matrix.asset_name }}
tag: ${{ steps.get_version.outputs.VERSION }}