-
-
Notifications
You must be signed in to change notification settings - Fork 4
153 lines (139 loc) · 4.57 KB
/
build.yml
File metadata and controls
153 lines (139 loc) · 4.57 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
name: Build Project
on:
push:
branches: [ "master" ]
pull_request:
jobs:
linux:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: i686-unknown-linux-gnu
deps: apt-get install -y gcc-multilib
- target: aarch64-unknown-linux-gnu
deps: apt-get install -y gcc-aarch64-linux-gnu
- target: armv7-unknown-linux-gnueabihf
deps: apt-get install -y gcc-arm-linux-gnueabihf
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
container:
image: ubuntu:18.04
steps:
- name: Checkout sources
uses: taiki-e/checkout-action@v1
- name: Install Essentials
run: |
apt-get update -y
apt-get upgrade -y
apt-get install -y curl gcc openjdk-17-jdk-headless
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install linker dependencies
run: ${{ matrix.deps }}
if: ${{ matrix.deps != '' }}
- name: Run Gradle Build
run: ./gradlew build -Ptarget=${{ matrix.target }}
linux-musl:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
arch: x86_64
- target: aarch64-unknown-linux-musl
arch: aarch64
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
container:
image: clux/muslrust:stable
steps:
- name: Checkout sources
uses: taiki-e/checkout-action@v1
- name: Install Essentials
run: |
apt-get update -y
apt-get upgrade -y
apt-get install -y gcc musl-tools curl openjdk-17-jdk-headless
- name: Install Rust toolchain
run: |
rustup target add x86_64-unknown-linux-musl ${{ matrix.target }}
- name: Install linker dependencies
run: |
mkdir -p /opt/musl
curl -L https://github.com/MinnDevelopment/musl-cross-mirror/releases/download/v0.0.1/${{ matrix.arch }}-linux-musl-cross.tgz | tar xz -C /opt/musl
- name: Run Gradle Build
env:
RUSTFLAGS: "-C target-feature=-crt-static -C link-args=-static-libgcc"
run: |
export PATH="/opt/musl/${{ matrix.arch }}-linux-musl-cross/bin:$PATH"
which ${{ matrix.arch }}-linux-musl-gcc
./gradlew build -Ptarget=${{ matrix.target }}
windows:
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
- target: i686-pc-windows-msvc
name: Build ${{ matrix.target }}
runs-on: windows-2022
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Run Gradle Build
run: ./gradlew build -Ptarget=${{ matrix.target }}
windows-aarch64:
name: Build aarch64-pc-windows-msvc
runs-on: windows-11-arm
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-pc-windows-msvc
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'microsoft'
java-version: '17'
cache: 'gradle'
- name: Run Gradle Build
run: ./gradlew build -Ptarget=aarch64-pc-windows-msvc
macos:
name: Build macOS universal binary
runs-on: macos-14
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Compile natives
working-directory: native
run: |
rustup target add x86_64-apple-darwin
cargo build -r --target=x86_64-apple-darwin
rustup target add aarch64-apple-darwin
cargo build -r --target=aarch64-apple-darwin
- name: Create target directory for darwin
run: mkdir -p native/target/darwin/release
- name: Combine to universal dylib
run: lipo -create -output native/target/darwin/release/libudpqueue.dylib native/target/**/release/*.dylib
- name: Run Gradle Build
run: ./gradlew build -x cargoBuild -Ptarget=darwin