-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
591 lines (576 loc) · 23 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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
name: Release
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64-apple-darwin
args: --release --out dist --strip
sccache: 'true'
- name: Install built wheel - x86_64
run: |
pip install aliyundrive-webdav --no-index --find-links dist --force-reinstall
aliyundrive-webdav --help
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist --strip
sccache: 'true'
- name: Install built wheel - universal2
run: |
pip install aliyundrive-webdav --no-index --find-links dist --force-reinstall
aliyundrive-webdav --help
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
if-no-files-found: error
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: apple-darwin-bin
path: target/release/aliyundrive-webdav
if-no-files-found: error
- name: Get tag
if: "startsWith(github.ref, 'refs/tags/')"
id: tag
uses: dawidd6/action-get-tag@v1
- name: Archive binary
if: "startsWith(github.ref, 'refs/tags/')"
run: |
cd target/release
tar czvf aliyundrive-webdav-${{ steps.tag.outputs.tag }}.apple-darwin.tar.gz aliyundrive-webdav
shasum -a 256 aliyundrive-webdav-${{ steps.tag.outputs.tag }}.apple-darwin.tar.gz > aliyundrive-webdav-${{ steps.tag.outputs.tag }}.apple-darwin.tar.gz.sha256
cd -
- name: Upload binary to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
target/release/aliyundrive-webdav*.tar.gz
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform:
- arch: x64
target: x86_64-pc-windows-msvc
- arch: x86
target: i686-pc-windows-msvc
- arch: arm64
target: aarch64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
if: matrix.platform.arch != 'arm64'
with:
python-version: 3.9
architecture: ${{ matrix.platform.arch }}
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels
if: matrix.platform.arch != 'arm64'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --strip
- name: Build wheels
if: matrix.platform.arch == 'arm64'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --strip --no-default-features --features atomic64,native-tls
sccache: 'true'
- name: Install built wheel
if: matrix.platform.arch != 'arm64'
run: |
pip install aliyundrive-webdav --no-index --find-links dist --force-reinstall
aliyundrive-webdav --help
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
if-no-files-found: error
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.platform.arch }}-bin
path: target/${{ matrix.platform.target }}/release/aliyundrive-webdav.exe
if-no-files-found: error
- name: Get tag
if: "startsWith(github.ref, 'refs/tags/')"
id: tag
uses: dawidd6/action-get-tag@v1
- name: Archive binary
if: "startsWith(github.ref, 'refs/tags/')"
run: |
cd target/${{ matrix.platform.target }}/release
7z a aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.zip aliyundrive-webdav.exe
cd -
- name: Upload binary to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
target/${{ matrix.platform.target }}/release/*.zip
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-musl"
wheel: true
deb: true
- target: "i686-unknown-linux-musl"
wheel: true
deb: true
- target: "aarch64-unknown-linux-musl"
wheel: true
deb: true
- target: "armv7-unknown-linux-musleabihf"
wheel: true
deb: true
- target: "armv7-unknown-linux-musleabi"
wheel: false
deb: true
- target: "arm-unknown-linux-musleabihf"
wheel: false
deb: false
- target: "arm-unknown-linux-musleabi"
wheel: false
deb: false
container:
image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.target }}
env:
CFLAGS_armv7_unknown_linux_musleabihf: '-mfpu=vfpv3-d16'
steps:
- uses: actions/checkout@v3
- name: Build wheels - manylinux
uses: PyO3/maturin-action@main
with:
target: ${{ matrix.platform.target }}
manylinux: auto
container: off
args: --release -o dist --strip
sccache: 'true'
- name: Build wheels - musllinux
if: matrix.platform.wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_1
container: off
args: --release --out dist --strip
sccache: 'true'
- name: Install cargo packages
if: matrix.platform.deb
run: pip install cargo-deb cargo-generate-rpm
- name: Build Debian package
if: matrix.platform.deb
run: cargo deb --target=${{ matrix.platform.target }} --no-build --no-strip
- name: Build RPM package
if: matrix.platform.deb
run: cargo generate-rpm --target=${{ matrix.platform.target }} --payload-compress none
- name: Upload wheels
if: matrix.platform.wheel
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
if-no-files-found: error
- name: Install upx
working-directory: /tmp
env:
CC: clang
CXX: clang++
run: |
set -ex
git clone --recursive https://github.com/upx/upx.git
cd upx
make
cp build/release/upx /usr/local/bin/upx
- name: Upx compress binary
run: upx target/${{ matrix.platform.target }}/release/aliyundrive-webdav
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.target }}-bin
path: target/${{ matrix.platform.target }}/release/aliyundrive-webdav
if-no-files-found: error
- name: Upload deb artifacts
if: matrix.platform.deb
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.target }}-deb
path: target/${{ matrix.platform.target }}/debian/aliyundrive-webdav_*.deb
if-no-files-found: error
- name: Upload RPM artifacts
if: matrix.platform.deb
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.target }}-rpm
path: target/${{ matrix.platform.target }}/generate-rpm/aliyundrive-webdav*.rpm
if-no-files-found: error
- name: Get tag
if: "startsWith(github.ref, 'refs/tags/')"
id: tag
uses: dawidd6/action-get-tag@v1
- name: Archive binary
if: "startsWith(github.ref, 'refs/tags/')"
run: |
cd target/${{ matrix.platform.target }}/release
tar czvf aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz aliyundrive-webdav
shasum -a 256 aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz > aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz.sha256
cd -
- name: Upload binaries to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
target/${{ matrix.platform.target }}/release/aliyundrive-webdav*.tar.gz*
target/${{ matrix.platform.target }}/debian/aliyundrive-webdav_*.deb
target/${{ matrix.platform.target }}/generate-rpm/aliyundrive-webdav*.rpm
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
- name: Remove cached deb and RPM packages
if: matrix.platform.deb
run: |
rm -rf target/${{ matrix.platform.target }}/debian
rm -rf target/${{ matrix.platform.target }}/generate-rpm
linux-others:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- target: "armv5te-unknown-linux-musleabi"
cargo_extra_args: --no-default-features --features rustls-tls
- target: "mips-unknown-linux-musl"
cargo_extra_args: --no-default-features --features native-tls-vendored
- target: "mipsel-unknown-linux-musl"
cargo_extra_args: --no-default-features --features native-tls-vendored
container:
image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.target }}
steps:
- uses: actions/checkout@v3
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform.target }}
- name: Build
env:
RUSTFLAGS: -C target-feature=+crt-static -C link-arg=-s
run: |
cargo build --release --target ${{ matrix.platform.target }} ${{ matrix.platform.cargo_extra_args }}
- name: Upx compress binary
uses: crazy-max/ghaction-upx@v1
with:
version: v3.95 # v3.96 breaks mipsel, https://github.com/upx/upx/issues/504
files: target/${{ matrix.platform.target }}/release/aliyundrive-webdav
- name: Upload binary artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.target }}-bin
path: target/${{ matrix.platform.target }}/release/aliyundrive-webdav
if-no-files-found: error
- name: Get tag
if: "startsWith(github.ref, 'refs/tags/')"
id: tag
uses: dawidd6/action-get-tag@v1
- name: Archive binary
if: "startsWith(github.ref, 'refs/tags/')"
run: |
cd target/${{ matrix.platform.target }}/release
tar czvf aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz aliyundrive-webdav
shasum -a 256 aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz > aliyundrive-webdav-${{ steps.tag.outputs.tag }}.${{ matrix.platform.target }}.tar.gz.sha256
cd -
- name: Upload binary to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
target/${{ matrix.platform.target }}/release/aliyundrive-webdav*.tar.gz*
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
openwrt:
name: OpenWrt Package - ${{ matrix.target.arch }}
runs-on: ubuntu-20.04
needs: [ linux, linux-others ]
environment: OpenWrt
strategy:
fail-fast: false
matrix:
target:
- arch: "aarch64_generic"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/rockchip/armv8/openwrt-sdk-22.03.2-rockchip-armv8_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a9"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/bcm53xx/generic/openwrt-sdk-22.03.2-bcm53xx-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a53"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/bcm27xx/bcm2710/openwrt-sdk-22.03.2-bcm27xx-bcm2710_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a72"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/bcm27xx/bcm2711/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "x86_64"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/openwrt-sdk-22.03.2-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "i386_pentium4"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/x86/generic/openwrt-sdk-22.03.2-x86-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_mpcore"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/oxnas/ox820/openwrt-sdk-22.03.2-oxnas-ox820_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a5_vfpv4"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/at91/sama5/openwrt-sdk-22.03.2-at91-sama5_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a7_neon-vfpv4"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/ipq40xx/generic/openwrt-sdk-22.03.2-ipq40xx-generic_gcc-11.2.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "mipsel_24kc"
sdk: "https://downloads.openwrt.org/releases/22.03.2/targets/ramips/mt7621/openwrt-sdk-22.03.2-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "mips_24kc"
sdk: "https://archive.openwrt.org/releases/19.07.7/targets/ar71xx/nand/openwrt-sdk-19.07.7-ar71xx-nand_gcc-7.5.0_musl.Linux-x86_64.tar.xz"
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential ccache ecj fastjar file g++ gawk \
gettext git java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python2.7-dev python3 unzip wget \
python3-distutils python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev
- name: Install OpenWrt SDK
run: |
set -e
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz && tar -xvf openwrt-sdk.tar
mv -f openwrt-sdk-* openwrt-sdk
- name: Build Package
run: |
set -e
echo "src-link aliyundrive $GITHUB_WORKSPACE/openwrt" > openwrt-sdk/feeds.conf
echo 'CONFIG_PACKAGE_aliyundrive-webdav=y
CONFIG_PACKAGE_luci-app-aliyundrive-webdav=y
' >> openwrt-sdk/.config
cd openwrt-sdk
cat feeds.conf.default >> feeds.conf
cat feeds.conf
./scripts/feeds update -a > /dev/null
make defconfig
./scripts/feeds install -d y -f -a
make package/aliyundrive-webdav/compile V=s
make package/luci-app-aliyundrive-webdav/compile V=s
tree bin/packages/
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: aliyundrive-webdav-openwrt-${{ matrix.target.arch }}
path: openwrt-sdk/bin/packages/*/aliyundrive/aliyundrive-webdav*.ipk
if-no-files-found: error
- name: Archive luci packages
uses: actions/upload-artifact@v3
if: ${{ matrix.target.arch == 'aarch64_generic' }}
with:
name: aliyundrive-webdav-openwrt-${{ matrix.target.arch }}
path: openwrt-sdk/bin/packages/*/aliyundrive/luci-*.ipk
if-no-files-found: error
- name: Upload package to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
openwrt-sdk/bin/packages/*/aliyundrive/aliyundrive-webdav*.ipk
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
- name: Upload luci packages to GitHub Release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.target.arch == 'aarch64_generic' }}
with:
files: |
openwrt-sdk/bin/packages/*/aliyundrive/luci-*.ipk
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
openwrt-gl-inet:
name: OpenWrt Package - ${{ matrix.target.arch }}
runs-on: ubuntu-latest
needs: [ linux, linux-others ]
environment: OpenWrt
strategy:
fail-fast: false
matrix:
target:
- arch: siflower-1806
path: sdk/1806/siflower
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential ccache ecj fastjar file g++ gawk \
gettext git java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python2.7-dev python3 unzip wget \
python3-distutils python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev
- name: Install OpenWrt SDK
run: |
set -e
git clone https://github.com/gl-inet/sdk.git openwrt-sdk
cd openwrt-sdk
./download.sh ${{ matrix.target.arch }}
- name: Build Package
run: |
set -e
cd openwrt-sdk/${{ matrix.target.path }}
ln -s $GITHUB_WORKSPACE/openwrt/aliyundrive-webdav package/aliyundrive-webdav
echo 'CONFIG_PACKAGE_aliyundrive-webdav=y
CONFIG_PACKAGE_luci-app-aliyundrive-webdav=y
' >> .config
cp feeds.conf.default feeds.conf
cat feeds.conf
./scripts/feeds update -a > /dev/null
make defconfig
./scripts/feeds install -d y -f -a
make package/aliyundrive-webdav/compile V=s
tree bin/packages/
- name: Archive package
uses: actions/upload-artifact@v3
with:
name: aliyundrive-webdav-openwrt-${{ matrix.target.arch }}
path: openwrt-sdk/${{ matrix.target.path }}/bin/packages/*/base/aliyundrive-webdav*.ipk
if-no-files-found: error
- name: Upload package to GitHub Release
uses: softprops/action-gh-release@v1
if: "startsWith(github.ref, 'refs/tags/')"
with:
files: |
openwrt-sdk/${{ matrix.target.path }}/bin/packages/*/base/aliyundrive-webdav*.ipk
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true
docker:
name: Build Docker Image
runs-on: ubuntu-latest
needs: [ linux ]
environment: Docker Hub
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: x86_64-unknown-linux-musl-bin
- run: |
chmod a+x aliyundrive-webdav
mv aliyundrive-webdav aliyundrive-webdav-amd64
- uses: actions/download-artifact@v3
with:
name: i686-unknown-linux-musl-bin
- run: |
chmod a+x aliyundrive-webdav
mv aliyundrive-webdav aliyundrive-webdav-386
- uses: actions/download-artifact@v3
with:
name: aarch64-unknown-linux-musl-bin
- run: |
chmod a+x aliyundrive-webdav
mv aliyundrive-webdav aliyundrive-webdav-arm64
- uses: actions/download-artifact@v3
with:
name: armv7-unknown-linux-musleabihf-bin
- run: |
chmod a+x aliyundrive-webdav
mv aliyundrive-webdav aliyundrive-webdav-armv7
- uses: actions/download-artifact@v3
with:
name: arm-unknown-linux-musleabihf-bin
- run: |
chmod a+x aliyundrive-webdav
mv aliyundrive-webdav aliyundrive-webdav-armv6
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
messense/aliyundrive-webdav
ghcr.io/messense/aliyundrive-webdav
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Setup QEMU
uses: dbhi/qus/action@main
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6
push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker Hub Description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: messense/aliyundrive-webdav
release:
name: Release
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/project/aliyundrive-webdav/
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux, macos ]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *