-
Notifications
You must be signed in to change notification settings - Fork 17
95 lines (90 loc) · 2.71 KB
/
binaries-check.yml
File metadata and controls
95 lines (90 loc) · 2.71 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
name: "Binaries (PR check)"
on:
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
PKG_CONFIG_ALLOW_CROSS: 1
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04
use_cross: true
features: vendored-openssl
- target: aarch64-unknown-linux-musl
os: ubuntu-24.04
use_cross: true
features: vendored-openssl
- target: aarch64-apple-darwin
os: macos-15
use_cross: false
features: vendored-openssl
- target: aarch64-pc-windows-msvc
os: windows-2022
use_cross: false
features: ""
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
use_cross: true
features: vendored-openssl
- target: x86_64-unknown-linux-musl
os: ubuntu-24.04
use_cross: true
features: vendored-openssl
- target: x86_64-apple-darwin
os: macos-15
use_cross: false
features: vendored-openssl
- target: x86_64-pc-windows-msvc
os: windows-2022
use_cross: false
features: ""
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Linux build deps
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev ca-certificates
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross == true
uses: taiki-e/install-action@v2
with:
tool: cross
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
if: endsWith(matrix.target, 'windows-msvc')
- name: Build target
run: |
set -euo pipefail
if [[ "${{ matrix.use_cross }}" == "true" ]]; then
cross build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES}
else
cargo build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES}
fi
env:
EXTRA_FEATURES: ${{ matrix.features && format('--features {0}', matrix.features) || '' }}