-
Notifications
You must be signed in to change notification settings - Fork 37
61 lines (51 loc) · 1.67 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
50
51
52
53
54
55
56
57
58
59
60
61
name: build-release-binary
on:
release:
types: [published]
env:
RUSTFLAGS: "-Dwarnings -C target-cpu=native"
RUST_BACKTRACE: 1
ACTIONS_RUNNER_DEBUG: true
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
- name: Setup Dependencies for MacOS workflow
if: matrix.os == 'macos-latest'
run: brew install gcc make openmpi
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "mpi-v5.0.6"
- name: Install MPI for MacOS workflow
if: matrix.os == 'macos-latest'
run: python3 ./scripts/install.py
- name: Set RUSTFLAGS for AVX
if: matrix.feature != 'macos-latest'
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')
});