-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.13 KB
/
rust.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
62
63
64
65
66
67
68
69
70
71
name: Build
on: [push]
jobs:
build:
# Set the job to run on the platform specified by the matrix below
runs-on: ${{ matrix.runner }}
# Define the build matrix for cross-compilation
strategy:
matrix:
include:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc
- name: macos-amd64
runner: macos-latest
target: x86_64-apple-darwin
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
# The steps to run for each matrix item
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: "${{ matrix.target }}"
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Build Binary
run: cargo build --verbose --locked --release --target ${{ matrix.target }}
- name: Move Binary
shell: bash
run: |
BIN_SUFFIX=""
if [[ "${{ matrix.runner }}" == "windows-latest" ]]; then
BIN_SUFFIX=".exe"
fi
# The built binary output location
BIN_OUTPUT="target/${{ matrix.target }}/release/basiclings${BIN_SUFFIX}"
mkdir artifact
# Move the built binary where you want it
mv "${BIN_OUTPUT}" "./artifact/basiclings${BIN_SUFFIX}"
mv "LICENSE" "LICENSE.basiclings"
- name: Build Autotester
shell: bash
run: |
git clone https://github.com/CE-Programming/CEmu.git
cd CEmu/core
make
cd ../tests/autotester
make
cd ../../../
mv "CEmu/tests/autotester/autotester${BIN_SUFFIX}" "./artifact/autotester${BIN_SUFFIX}"
mv "CEmu/LICENSE" "./artifact/LICENSE.autotester"
- name: Upload
uses: actions/[email protected]
with:
name: "basiclings-${{ matrix.name }}"
path: "artifact/"