-
Notifications
You must be signed in to change notification settings - Fork 33
49 lines (47 loc) · 1.57 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: build-release-binary
on:
release:
types: [published]
env:
RUSTFLAGS: "-Dwarnings -C target-cpu=native"
RUST_BACKTRACE: 1
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
binary_name: expander-macos
- os: 7950x3d
feature: avx2
binary_name: expander-linux-avx2
- os: 7950x3d
feature: avx512f
binary_name: expander-linux-avx512
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: 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: '${{ matrix.binary_name }}',
data: await fs.readFile('target/release/expander-exec')
});