-
-
Notifications
You must be signed in to change notification settings - Fork 4
189 lines (173 loc) · 6.63 KB
/
publish.yml
File metadata and controls
189 lines (173 loc) · 6.63 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: publish-natives
on:
workflow_dispatch:
concurrency:
group: "pub"
cancel-in-progress: true
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: Publish ${{ matrix.target }}
environment: MavenRelease
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: Build and Publish
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew native:publish native:jreleaserDeploy -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: Publish ${{ matrix.target }}
environment: MavenRelease
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: Build and Publish
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
RUSTFLAGS: "-C target-feature=-crt-static -C link-args=-static-libgcc"
run: |
export PATH="/opt/musl/${{ matrix.arch }}-linux-musl-cross/bin:$PATH"
./gradlew native:publish native:jreleaserDeploy -Ptarget=${{ matrix.target }}
windows:
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
- target: i686-pc-windows-msvc
name: Publish ${{ matrix.target }}
environment: MavenRelease
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: Build and Publish
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew native:publish native:jreleaserDeploy -Ptarget=${{ matrix.target }}
windows-aarch64:
name: Publish aarch64-pc-windows-msvc
environment: MavenRelease
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: Build and Publish
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew native:publish native:jreleaserDeploy -Ptarget=aarch64-pc-windows-msvc
macos:
name: Build macOS universal binary
environment: MavenRelease
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: Build and Publish
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew native:publish native:jreleaserDeploy -Ptarget=darwin -x cargoBuild