-
Notifications
You must be signed in to change notification settings - Fork 40
144 lines (120 loc) · 4.35 KB
/
release.yml
File metadata and controls
144 lines (120 loc) · 4.35 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Reckless Releases
on: [workflow_dispatch]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build for ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
name: reckless-linux-generic
rustflags: "-C target-cpu=x86-64"
- os: ubuntu-latest
name: reckless-linux-avx2
rustflags: "-C target-cpu=x86-64-v3"
sde_flag: -bdw
- os: ubuntu-latest
name: reckless-linux-avx512
rustflags: "-C target-cpu=x86-64-v4 -C target-feature=+gfni,+avx512bw,+avx512vl,+avx512vbmi,+avx512vbmi2,+avx512vnni,+avx512bitalg"
sde_flag: -icx
- os: windows-latest
name: reckless-windows-generic
rustflags: "-C target-cpu=x86-64"
- os: windows-latest
name: reckless-windows-avx2
rustflags: "-C target-cpu=x86-64-v3"
sde_flag: -bdw
- os: windows-latest
name: reckless-windows-avx512
rustflags: "-C target-cpu=x86-64-v4 -C target-feature=+gfni,+avx512bw,+avx512vl,+avx512vbmi,+avx512vbmi2,+avx512vnni,+avx512bitalg"
sde_flag: -icx
- os: macos-latest
name: reckless-macos
rustflags: "-C target-cpu=native"
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@1.93.1
- name: Install dependencies
run: |
rustup component add llvm-tools
cargo install cargo-pgo
- name: Setup Intel SDE
if: matrix.name != 'reckless-macos' && matrix.name != 'reckless-linux-generic' && matrix.name != 'reckless-windows-generic'
uses: petarpetrovt/setup-sde@08ea32f9214634afad4f33b74841782e71768e52
with:
sdeVersion: "9.58.0"
environmentVariableName: SDE_PATH
- name: Instrument build for PGO
run: |
cargo pgo instrument
env:
RUSTFLAGS: "${{ matrix.rustflags }}"
- name: Run PGO profiling benchmarks
if: matrix.name == 'reckless-linux-avx2' || matrix.name == 'reckless-linux-avx512'
run: |
"$SDE_PATH/sde64" ${{ matrix.sde_flag }} -- cargo pgo run -- bench
env:
RUSTFLAGS: "${{ matrix.rustflags }}"
- name: Run PGO profiling benchmarks
if: matrix.name == 'reckless-windows-avx2' || matrix.name == 'reckless-windows-avx512'
shell: cmd
run: |
"%SDE_PATH%\sde.exe" ${{ matrix.sde_flag }} -- cargo pgo run -- bench
env:
RUSTFLAGS: "${{ matrix.rustflags }}"
- name: Run PGO profiling benchmarks
if: matrix.name == 'reckless-macos' || matrix.name == 'reckless-linux-generic' || matrix.name == 'reckless-windows-generic'
run: |
cargo pgo run -- bench
env:
RUSTFLAGS: "${{ matrix.rustflags }}"
- name: Optimize build with PGO
run: |
cargo pgo optimize
env:
RUSTFLAGS: "${{ matrix.rustflags }}"
- name: Rename binary with platform suffix
shell: bash
run: |
tuple=$(rustc --print host-tuple)
if [ "${{ runner.os }}" = "Windows" ]; then
mv target\\$tuple\\release\\reckless.exe ${{ matrix.name }}.exe
else
mv target/$tuple/release/reckless ${{ matrix.name }}
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v5.0.0
with:
name: ${{ matrix.name }}
path: |
${{ matrix.name }}
${{ matrix.name }}.exe
retention-days: 1
release:
name: Development release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Get short SHA hash
id: hash
run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
- name: Download build artifacts
uses: actions/download-artifact@v6.0.0
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2.4.1
with:
name: Reckless 0.9.0-dev-${{ env.COMMIT_SHA }}
draft: true
prerelease: true
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}