@@ -14,38 +14,162 @@ env:
14
14
DOCKER_BUILDKIT : 1
15
15
16
16
jobs :
17
- main :
17
+ aarch64 :
18
+ runs-on : ubuntu-24.04-arm
19
+ steps :
20
+
21
+ - name : Clone repository
22
+ uses : actions/checkout@v4
23
+
24
+ - name : Set architecture variable
25
+ run : echo "ARCHITECTURE=$(uname -m)" >> $GITHUB_ENV
26
+
27
+ - name : Build image
28
+ run : ./generate.sh
29
+
30
+ - name : Login to Docker Hub
31
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
32
+ uses : docker/login-action@v3
33
+ with :
34
+ username : grimler
35
+ password : ${{ secrets.GRIMLER_DOCKER_TOKEN }}
36
+
37
+ - name : Push to Docker Hub
38
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
39
+ run : |
40
+ docker push termux/termux-docker:${{ matrix.CPU_ARCH }}
41
+ if [ ${{ matrix.CPU_ARCH }} = i686 ]; then
42
+ docker tag termux/termux-docker:i686 termux/termux-docker:latest
43
+ docker push termux/termux-docker:latest
44
+ fi
45
+
46
+ - name : Export container as tar archive
47
+ if : always()
48
+ run : |
49
+ docker run \
50
+ --name termux-docker \
51
+ termux/termux-docker:"${ARCHITECTURE}" \
52
+ uname -a
53
+ docker stop termux-docker
54
+ docker export -o termux-docker.tar \
55
+ termux-docker
56
+ sha256sum termux-docker.tar
57
+
58
+ - name : Store tar archive
59
+ if : always()
60
+ uses : actions/upload-artifact@v4
61
+ with :
62
+ name : termux-docker-${{ github.sha }}
63
+ path : termux-docker.tar
64
+
65
+ arm :
66
+ runs-on : ubuntu-24.04-arm
67
+ steps :
68
+
69
+ - name : Clone repository
70
+ uses : actions/checkout@v4
71
+
72
+ - name : Set architecture variable
73
+ run : echo "ARCHITECTURE=arm" >> $GITHUB_ENV
74
+
75
+ - name : Build image
76
+ run : ./generate.sh
77
+
78
+ - name : Login to Docker Hub
79
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
80
+ uses : docker/login-action@v3
81
+ with :
82
+ username : grimler
83
+ password : ${{ secrets.GRIMLER_DOCKER_TOKEN }}
84
+
85
+ - name : Push to Docker Hub
86
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
87
+ run : |
88
+ docker push termux/termux-docker:${{ matrix.CPU_ARCH }}
89
+ if [ ${{ matrix.CPU_ARCH }} = i686 ]; then
90
+ docker tag termux/termux-docker:i686 termux/termux-docker:latest
91
+ docker push termux/termux-docker:latest
92
+ fi
93
+
94
+ - name : Export container as tar archive
95
+ if : always()
96
+ run : |
97
+ docker run \
98
+ --name termux-docker \
99
+ termux/termux-docker:"${ARCHITECTURE}" \
100
+ uname -a
101
+ docker stop termux-docker
102
+ docker export -o termux-docker.tar \
103
+ termux-docker
104
+ sha256sum termux-docker.tar
105
+
106
+ - name : Store tar archive
107
+ if : always()
108
+ uses : actions/upload-artifact@v4
109
+ with :
110
+ name : termux-docker-${{ github.sha }}
111
+ path : termux-docker.tar
112
+
113
+ x86_64 :
18
114
runs-on : ubuntu-latest
19
- strategy :
20
- matrix :
21
- CPU_ARCH :
22
- - aarch64
23
- - arm
24
- - i686
25
- - x86_64
26
115
steps :
27
116
28
117
- name : Clone repository
29
118
uses : actions/checkout@v4
30
119
31
- - name : Setup binfmt_misc
32
- if : (matrix.CPU_ARCH == 'aarch64') || (matrix.CPU_ARCH == 'arm')
33
- run : docker run --rm --privileged aptman/qus -s -- -p aarch64 arm
120
+ - name : Set architecture variable
121
+ run : echo "ARCHITECTURE=$(uname -m)" >> $GITHUB_ENV
34
122
35
- - name : Build images
123
+ - name : Build image
124
+ run : ./generate.sh
125
+
126
+ - name : Login to Docker Hub
127
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
128
+ uses : docker/login-action@v3
129
+ with :
130
+ username : grimler
131
+ password : ${{ secrets.GRIMLER_DOCKER_TOKEN }}
132
+
133
+ - name : Push to Docker Hub
134
+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
36
135
run : |
37
- case '${{ matrix.CPU_ARCH }}' in
38
- arm) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm/v7";;
39
- aarch64) SYSTEM_TYPE=arm; PLATFORM_TAG="linux/arm64";;
40
- i686) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/386";;
41
- *) SYSTEM_TYPE=x86; PLATFORM_TAG="linux/amd64";;
42
- esac
43
- docker buildx build -t \
44
- termux/termux-docker:${{ matrix.CPU_ARCH }} \
45
- --platform "$PLATFORM_TAG" \
46
- --build-arg BOOTSTRAP_ARCH=${{ matrix.CPU_ARCH }} \
47
- --build-arg SYSTEM_TYPE="${SYSTEM_TYPE}" \
48
- .
136
+ docker push termux/termux-docker:${{ matrix.CPU_ARCH }}
137
+ if [ ${{ matrix.CPU_ARCH }} = i686 ]; then
138
+ docker tag termux/termux-docker:i686 termux/termux-docker:latest
139
+ docker push termux/termux-docker:latest
140
+ fi
141
+
142
+ - name : Export container as tar archive
143
+ if : always()
144
+ run : |
145
+ docker run \
146
+ --name termux-docker \
147
+ termux/termux-docker:"${ARCHITECTURE}" \
148
+ uname -a
149
+ docker stop termux-docker
150
+ docker export -o termux-docker.tar \
151
+ termux-docker
152
+ sha256sum termux-docker.tar
153
+
154
+ - name : Store tar archive
155
+ if : always()
156
+ uses : actions/upload-artifact@v4
157
+ with :
158
+ name : termux-docker-${{ github.sha }}
159
+ path : termux-docker.tar
160
+
161
+ i686 :
162
+ runs-on : ubuntu-latest
163
+ steps :
164
+
165
+ - name : Clone repository
166
+ uses : actions/checkout@v4
167
+
168
+ - name : Set architecture variable
169
+ run : echo "ARCHITECTURE=i686" >> $GITHUB_ENV
170
+
171
+ - name : Build image
172
+ run : ./generate.sh
49
173
50
174
- name : Login to Docker Hub
51
175
if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-docker'
@@ -67,18 +191,17 @@ jobs:
67
191
if : always()
68
192
run : |
69
193
docker run \
70
- --privileged \
71
- --name termux-docker-${{ matrix.CPU_ARCH }} \
72
- termux/termux-docker:${{ matrix.CPU_ARCH }} \
194
+ --name termux-docker \
195
+ termux/termux-docker:"${ARCHITECTURE}" \
73
196
uname -a
74
- docker stop termux-docker-${{ matrix.CPU_ARCH }}
75
- docker export -o termux-docker-${{ matrix.CPU_ARCH }} .tar \
76
- termux-docker-${{ matrix.CPU_ARCH }}
77
- sha256sum termux-docker-${{ matrix.CPU_ARCH }} .tar
197
+ docker stop termux-docker
198
+ docker export -o termux-docker.tar \
199
+ termux-docker
200
+ sha256sum termux-docker.tar
78
201
79
202
- name : Store tar archive
80
203
if : always()
81
204
uses : actions/upload-artifact@v4
82
205
with :
83
- name : termux-docker-${{ matrix.CPU_ARCH }}-${{ github.sha }}
84
- path : termux-docker-${{ matrix.CPU_ARCH }} .tar
206
+ name : termux-docker-${{ github.sha }}
207
+ path : termux-docker.tar
0 commit comments