-
-
Notifications
You must be signed in to change notification settings - Fork 50
285 lines (270 loc) · 9.83 KB
/
release.yml
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: Release Packages
on:
release:
types: [ published ]
jobs:
build_tag:
name: "Build Tag Name"
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
release_version: ${{ steps.ref.outputs.version }}
steps:
- name: " Build Tag"
id: ref
shell: bash
run: |
ref="${{ github.ref }}";
ref="${ref//refs\/heads\//}";
ref="${ref//refs\/tags\//}";
ref="${ref//master/dev}";
echo "$ref";
echo "version=$ref" >> "$GITHUB_OUTPUT"
build-deb:
name: "Release ${{ matrix.platform.name }}"
strategy:
matrix:
platform:
- name: ubuntu-20.04_arm64
target: aarch64-unknown-linux-gnu
image: ubuntu:20.04
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: ubuntu-20.04_amd64
target: x86_64-unknown-linux-gnu
image: ubuntu:20.04
- name: ubuntu-22.04_arm64
target: aarch64-unknown-linux-gnu
image: ubuntu:22.04
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: ubuntu-22.04_amd64
target: x86_64-unknown-linux-gnu
image: ubuntu:22.04
- name: ubuntu-24.04_arm64
target: aarch64-unknown-linux-gnu
image: ubuntu:24.04
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: ubuntu-24.04_amd64
target: x86_64-unknown-linux-gnu
image: ubuntu:24.04
- name: debian-10_arm64
target: aarch64-unknown-linux-gnu
image: debian:10-slim
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: debian-10_amd64
target: x86_64-unknown-linux-gnu
image: debian:10-slim
- name: debian-11_arm64
target: aarch64-unknown-linux-gnu
image: debian:11-slim
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: debian-11_amd64
target: x86_64-unknown-linux-gnu
image: debian:11-slim
- name: debian-12_arm64
target: aarch64-unknown-linux-gnu
image: debian:12-slim
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: debian-12_amd64
target: x86_64-unknown-linux-gnu
image: debian:12-slim
- name: debian-sid_arm64
target: aarch64-unknown-linux-gnu
image: debian:sid-slim
build-args: "--features zlib-ng-compat"
pkg-args: --no-strip
- name: debian-sid_amd64
target: x86_64-unknown-linux-gnu
image: debian:sid-slim
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [ build_tag ]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-deb
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
toolchain: stable
args: "--release ${{ matrix.platform.build-args }}"
- name: "Build Deb"
run: $HOME/.cargo/bin/cargo +stable deb ${{ matrix.platform.pkg-args }} --no-build --target ${{ matrix.platform.target }} --output "target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}.deb"
- name: "Upload Release"
uses: softprops/action-gh-release@v1
with:
files: |
target/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-rpm:
name: "Release ${{ matrix.platform.name }}"
strategy:
matrix:
platform:
- name: fedora-39_arm64
target: aarch64-unknown-linux-gnu
image: fedora:39
build-args: "--features zlib-ng-compat"
- name: fedora-39_amd64
target: x86_64-unknown-linux-gnu
image: fedora:39
- name: fedora-40_arm64
target: aarch64-unknown-linux-gnu
image: fedora:40
build-args: "--features zlib-ng-compat"
- name: fedora-40_amd64
target: x86_64-unknown-linux-gnu
image: fedora:40
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [ build_tag ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-generate-rpm
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
toolchain: stable
args: "--release ${{ matrix.platform.build-args }}"
- name: "Build RPM"
run: $HOME/.cargo/bin/cargo +stable generate-rpm --target ${{ matrix.platform.target }} --output "target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}.rpm"
- name: "Upload Release"
uses: softprops/action-gh-release@v1
with:
files: |
target/*.rpm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-other:
name: "Release ${{ matrix.platform.name }}"
continue-on-error: true
strategy:
matrix:
platform:
# Alpine
- name: alpine_arm64
target: aarch64-unknown-linux-gnu
build-args: "--features zlib-ng-compat"
- name: alpine_amd64
target: x86_64-unknown-linux-gnu
# Arch
- name: arch_arm64
target: aarch64-unknown-linux-gnu
build-args: "--features zlib-ng-compat"
- name: arch_amd64
target: x86_64-unknown-linux-gnu
# Raspberry PI
- name: pi0-1_arm
target: arm-unknown-linux-gnueabihf
- name: pi2-4_armv7
target: armv7-unknown-linux-gnueabihf
build-args: "--features zlib-ng-compat"
- name: pi5_arm64
target: aarch64-unknown-linux-gnu
build-args: "--features zlib-ng-compat"
needs: [ build_tag ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
toolchain: stable
args: "--release ${{ matrix.platform.build-args }}"
- name: "Copy"
run: cp target/${{ matrix.platform.target }}/release/interactive-rebase-tool target/release/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}
- name: "Upload Release"
uses: softprops/action-gh-release@v1
with:
files: target/release/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
name: "Release macOS-${{ matrix.platform.macos }}_${{ matrix.platform.name }}"
strategy:
matrix:
platform:
- name: macos-12_arm
target: aarch64-apple-darwin
macos: 12
- name: macos-12_intel
target: x86_64-apple-darwin
macos: 12
- name: macos-13_arm
target: aarch64-apple-darwin
macos: 13
- name: macos-13_intel
target: x86_64-apple-darwin
macos: 13
- name: macos-14_arm
target: aarch64-apple-darwin
macos: 14
- name: macos-14_intel
target: x86_64-apple-darwin
macos: 14
runs-on: macos-${{ matrix.platform.macos }}
timeout-minutes: 5
needs: [ build_tag ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.platform.target }}
- name: "Build"
run: "cargo +stable build --release --target ${{ matrix.platform.target }}"
- name: "Rename"
run: "cp target/${{ matrix.platform.target }}/release/interactive-rebase-tool target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}"
- name: "Upload Release"
uses: softprops/action-gh-release@v1
with:
files: target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-${{ matrix.platform.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
name: "Release Windows_${{ matrix.target }}"
strategy:
matrix:
target: [ 'aarch64', 'x86_64' ]
runs-on: windows-latest
timeout-minutes: 10
needs: [ build_tag ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: "${{ matrix.target }}-pc-windows-msvc"
- name: "Build"
run: "cargo rustc --target ${{ matrix.target }}-pc-windows-msvc --release --bin interactive-rebase-tool"
- name: "Rename"
run: "copy target/${{ matrix.target }}-pc-windows-msvc/release/interactive-rebase-tool.exe target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-windows-${{ matrix.version }}_${{ matrix.target }}.exe"
- name: "Upload Release"
uses: softprops/action-gh-release@v1
with:
files: target/git-interactive-rebase-tool-${{ needs.build_tag.outputs.release_version }}-windows-${{ matrix.version }}_${{ matrix.target }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}