-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (85 loc) · 3.02 KB
/
Copy pathrelease-engine.yml
File metadata and controls
101 lines (85 loc) · 3.02 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
name: Release Engine Binary
on:
push:
tags:
- "engine-v*"
permissions: {}
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
binary: evaluate
asset: evaluate-linux-amd64
- target: x86_64-apple-darwin
os: macos-latest
binary: evaluate
asset: evaluate-macos-amd64
- target: aarch64-apple-darwin
os: macos-latest
binary: evaluate
asset: evaluate-macos-arm64
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
targets: ${{ matrix.target }}
- name: Install mold linker (Linux)
# x86_64-linux builds use the mold linker from packages/.cargo/config.toml.
# The macOS targets fall outside that target-scoped config, so no mold there.
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y mold
- name: Cache cargo registry
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: |
~/.cargo/registry
~/.cargo/git
packages/target
key: ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('packages/**/Cargo.toml', 'packages/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-cargo-release-
- name: Build release binary
run: |
cd packages/engine
cargo build --release --locked --bin evaluate --target ${{ matrix.target }}
- name: Prepare artifact
run: |
cp packages/target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.asset }}
chmod +x ${{ matrix.asset }}
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ matrix.asset }}
path: ${{ matrix.asset }}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v2
with:
generate_release_notes: true
files: |
artifacts/evaluate-linux-amd64/evaluate-linux-amd64
artifacts/evaluate-macos-amd64/evaluate-macos-amd64
artifacts/evaluate-macos-arm64/evaluate-macos-arm64