5
5
tags :
6
6
- ' v*'
7
7
8
+ env :
9
+ IMAGE_REGISTRY : ' xhofe/alist'
10
+ REGISTRY_USERNAME : ' xhofe'
11
+ REGISTRY_PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
12
+ ARTIFACT_NAME : ' binaries_docker_release'
13
+ RELEASE_PLATFORMS : ' linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64'
14
+
8
15
jobs :
9
- release_docker :
10
- name : Release Docker
16
+ build_binary :
17
+ name : Build Binaries for Docker Release
11
18
runs-on : ubuntu-latest
12
19
steps :
13
20
- name : Checkout
@@ -31,11 +38,45 @@ jobs:
31
38
- name : Build go binary
32
39
run : bash build.sh release docker-multiplatform
33
40
34
- - name : Docker meta
35
- id : meta
36
- uses : docker/metadata-action@v5
41
+ - name : Upload artifacts
42
+ uses : actions/upload-artifact@v4
37
43
with :
38
- images : xhofe/alist
44
+ name : ${{ env.ARTIFACT_NAME }}
45
+ overwrite : true
46
+ path : |
47
+ build/
48
+ !build/*.tgz
49
+ !build/musl-libs/**
50
+
51
+ release_docker :
52
+ needs : build_binary
53
+ name : Release Docker image
54
+ runs-on : ubuntu-latest
55
+ strategy :
56
+ matrix :
57
+ image : ["latest", "ffmpeg", "aria2", "aio"]
58
+ include :
59
+ - image : " latest"
60
+ build_arg : " "
61
+ tag_favor : " "
62
+ - image : " ffmpeg"
63
+ build_arg : INSTALL_FFMPEG=true
64
+ tag_favor : " suffix=-ffmpeg, class="pl-pds">"
65
+ - image : " aria2"
66
+ build_arg : INSTALL_ARIA2=true
67
+ tag_favor : " suffix=-aria2,
EDBE
ue"
68
+ - image : " aio"
69
+ build_arg : |
70
+ INSTALL_FFMPEG=true
71
+ INSTALL_ARIA2=true
72
+ tag_favor : " suffix=-aio, class="pl-pds">"
73
+ steps :
74
+ - name : Checkout
75
+ uses : actions/checkout@v4
76
+ - uses : actions/download-artifact@v4
77
+ with :
78
+ name : ${{ env.ARTIFACT_NAME }}
79
+ path : ' build/'
39
80
40
81
- name : Set up QEMU
41
82
uses : docker/setup-qemu-action@v3
@@ -46,63 +87,26 @@ jobs:
46
87
- name : Login to DockerHub
47
88
uses : docker/login-action@v3
48
89
with :
49
- username : xhofe
50
- password : ${{ secrets.DOCKERHUB_TOKEN }}
90
+ username : ${{ env.REGISTRY_USERNAME }}
91
+ password : ${{ env.REGISTRY_PASSWORD }}
51
92
52
- - name : Build and push
53
- id : docker_build
54
- uses : docker/build-push-action@v6
55
- with :
56
- context : .
57
- file : Dockerfile.ci
58
- push : true
59
- tags : ${{ steps.meta.outputs.tags }}
60
- labels : ${{ steps.meta.outputs.labels }}
61
- platforms : linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64
62
-
63
- - name : Docker meta with ffmpeg
64
- id : meta-ffmpeg
93
+ - name : Docker meta
94
+ id : meta
65
95
uses : docker/metadata-action@v5
66
96
with :
67
- images : xhofe/alist
97
+ images : ${{ env.IMAGE_REGISTRY }}
68
98
flavor : |
69
99
latest=true
70
- suffix=-ffmpeg,>
71
-
72
- - name : Build and push with ffmpeg
73
- id : docker_build_ffmpeg
100
+ ${{ matrix.tag_favor }}
101
+
102
+ - name : Build and push
103
+ id : docker_build
74
104
uses : docker/build-push-action@v6
75
105
with :
76
106
context : .
77
107
file : Dockerfile.ci
78
108
push : true
79
- tags : ${{ steps.meta-ffmpeg.outputs.tags }}
80
- labels : ${{ steps.meta-ffmpeg.outputs.labels }}
81
- build-args : INSTALL_FFMPEG=true
82
- platforms : linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64
83
-
84
- release_docker_with_aria2 :
85
- needs : release_docker
86
- name : Release docker with aria2
87
- runs-on : ubuntu-latest
88
- steps :
89
- - name : Checkout repo
90
- uses : actions/checkout@v4
91
- with :
92
- repository : alist-org/with_aria2
93
- ref : main
94
- persist-credentials : false
95
- fetch-depth : 0
96
<
10000
span class="diff-text-marker">-
97
- - name : Add tag
98
- run : |
99
- git config --local user.email "bot@nn.ci"
100
- git config --local user.name "IlaBot"
101
- git tag -a ${{ github.ref_name }} -m "release ${{ github.ref_name }}"
102
-
103
- - name : Push tags
104
- uses : ad-m/github-push-action@master
105
- with :
106
- github_token : ${{ secrets.MY_TOKEN }}
107
- branch : main
108
- repository : alist-org/with_aria2
109
+ build-args : ${{ matrix.build_arg }}
110
+ tags : ${{ steps.meta.outputs.tags }}
111
+ labels : ${{ steps.meta.outputs.labels }}
112
+ platforms : ${{ env.RELEASE_PLATFORMS }}
0 commit comments