forked from singjc/arycal
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (154 loc) · 6.04 KB
/
Copy pathrust-release.yml
File metadata and controls
174 lines (154 loc) · 6.04 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Release
permissions:
contents: write
on:
push:
tags:
- 'v[0-9]+.*'
jobs:
# 1) Create the GitHub release
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
id: create
with:
token: ${{ secrets.GITHUB_TOKEN }}
# 2) Fast normal builds in parallel, using taiki-e/upload-rust-binary-action
upload_assets:
name: Build & Upload Binaries
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# CLI: dynamic musl via musl-gcc
- name: arycal-cli-linux-musl
bin: arycal
os: ubuntu-latest
build: |
sudo apt-get update && sudo apt-get install -y musl-tools
CC=musl-gcc cargo build --release
cp target/release/arycal artifacts/arycal-cli
# CLI: fully static musl via cross
- name: arycal-cli-linux-musl-static
bin: arycal
target: x86_64-unknown-linux-musl
os: ubuntu-latest
build: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target=x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/arycal artifacts/arycal-cli
# CLI: glibc + MPI
- name: arycal-cli-linux-gnu-mpi
bin: arycal
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
build: |
sudo apt-get update && sudo apt-get install -y libopenmpi-dev openmpi-bin
cargo build --release --target=x86_64-unknown-linux-gnu --features mpi
cp target/x86_64-unknown-linux-gnu/release/arycal artifacts/arycal-cli
# GUI: glibc on Ubuntu 22.04
- name: arycal-gui-linux-gnu
bin: arycal-gui
target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
build: |
sudo apt-get update && sudo apt-get install -y \
libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libegl1-mesa libgtk-3-dev
cargo build --release --target=x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/arycal-gui artifacts/arycal-gui
# macOS + Windows
- name: arycal-cli-macos
bin: arycal
target: x86_64-apple-darwin
os: macos-latest
build: |
rustup target add x86_64-apple-darwin
cargo build --release --target=x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/arycal artifacts/arycal-cli
- name: arycal-gui-macos
bin: arycal-gui
target: x86_64-apple-darwin
os: macos-latest
build: |
rustup target add x86_64-apple-darwin
cargo build --release --target=x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/arycal-gui artifacts/arycal-gui
- name: arycal-cli-windows
bin: arycal
target: x86_64-pc-windows-msvc
os: windows-latest
build: |
rustup target add x86_64-pc-windows-msvc
cargo build --release --target=x86_64-pc-windows-msvc
cp target/x86_64-pc-windows-msvc/release/arycal.exe artifacts/arycal-cli.exe
- name: arycal-gui-windows
bin: arycal-gui
target: x86_64-pc-windows-msvc
os: windows-latest
build: |
rustup target add x86_64-pc-windows-msvc
cargo build --release --target=x86_64-pc-windows-msvc
cp target/x86_64-pc-windows-msvc/release/arycal-gui.exe artifacts/arycal-gui.exe
steps:
- uses: actions/checkout@v4
- run: mkdir -p artifacts
- name: Cache Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.name }}-
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.85.0
override: true
- name: Build
run: bash -lc "${{ matrix.build }}"
- name: Upload Binaries
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: ${{ matrix.bin }}
archive: ${{ matrix.bin }}-${{ github.ref_name }}-${{ matrix.name }}
target: ${{ matrix.target || '' }}
include: LICENSE,README.md
tar: unix
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}
# 3) Compat GUI build inside Ubuntu 18.04 & upload via GH CLI
upload_assets_compat:
name: Compat GUI Build (Ubuntu 18.04)
needs: create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & package in Ubuntu 18.04
run: |
docker run --rm \
-v "$(pwd)":/work -w /work ubuntu:18.04 bash -lc "
apt-get update &&
apt-get install -y curl build-essential pkg-config libssl-dev \
libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev \
libegl1-mesa libgtk-3-dev &&
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.85.0 &&
source \$HOME/.cargo/env &&
rustup target add x86_64-unknown-linux-gnu &&
cargo build --release --target=x86_64-unknown-linux-gnu &&
tar -czf arycal-gui-${{ github.ref_name }}-compat.tar.gz \
-C target/x86_64-unknown-linux-gnu/release arycal-gui
"
- name: Upload Compat Binary via GH CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.ref_name }}" \
arycal-gui-${{ github.ref_name }}-compat.tar.gz