Skip to content

build-release-binary #16

build-release-binary

build-release-binary #16

Workflow file for this run

name: build-release-binary
on:
release:
types: [published]
env:
RUSTFLAGS: "-Dwarnings"
RUST_BACKTRACE: 1
jobs:
build:
strategy:
matrix:
platform: [macos, 7950x3d]
include:
- platform: macos
os: macos-latest
- platform: 7950x3d
os: ubuntu-latest
feature: avx2
- platform: 7950x3d
os: ubuntu-latest
feature: avx512f
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# The prefix cache key, this can be changed to start a new cache manually.
prefix-key: "mpi-v5.0.5" # update me if brew formula changes to a new version
- name: Install MPI
run: python3 ./scripts/install.py
- name: Set RUSTFLAGS for AVX
if: matrix.feature != ''
run: echo "RUSTFLAGS=$RUSTFLAGS -C target-feature=+${{ matrix.feature }}" >> $GITHUB_ENV
- name: Prepare binary
run: ${{ matrix.flags }} cargo build --release --bin expander-exec
- name: Upload release asset
uses: actions/github-script@v6
with:
script: |
const fs = require('fs').promises;
github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ github.event.release.id }},
name: 'expander-exec-${{ matrix.os }}-${{ matrix.feature }}',
data: await fs.readFile('target/release/expander-exec')
});