forked from ao-space/gt
-
Notifications
You must be signed in to change notification settings - Fork 0
275 lines (260 loc) · 10.3 KB
/
container.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
name: container build and push
on:
push:
branches: [ "*" ]
tags: [ '*.*.*' ]
pull_request:
branches: [ "*" ]
env:
REGISTRY: ghcr.io
EULIX_REGISTRY: hub.eulix.xyz
HUAWEICLOUD_REGISTRY_SH: swr.cn-east-3.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_BJ: swr.cn-north-4.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_GZ: swr.cn-south-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_HK: swr.ap-southeast-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_SG: swr.ap-southeast-3.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_AF: swr.af-south-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_LA: swr.la-north-2.myhuaweicloud.com
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: package-server
run: |-
sudo apt-get update && sudo apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu -y
GOARCH=amd64 make release_server && mv release/linux-amd64-server release/linux-x86_64-server
TARGET=aarch64-linux-gnu GOOS=linux GOARCH=arm64 make release_server && mv release/linux-arm64-server release/linux-aarch64-server
ls -al release
- name: package-client
run: |-
sudo apt-get update && sudo apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu -y
GOARCH=amd64 make release_client && mv release/linux-amd64-client release/linux-x86_64-client
TARGET=aarch64-linux-gnu GOOS=linux GOARCH=arm64 make release_client && mv release/linux-arm64-client release/linux-aarch64-client
ls -al release
- name: Archive Server artifacts
uses: actions/upload-artifact@v3
with:
name: gt-server
path: |
release/*-server
- name: Archive Client artifacts
uses: actions/upload-artifact@v3
with:
name: gt-client
path: |
release/*-client
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- run: echo "GITHUB_REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
shell: bash
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
# - name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Log into registry ${{ env.EULIX_REGISTRY }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.EULIX_REGISTRY }}
# username: ${{ secrets.EULIX_REGISTRY_USERNAME }}
# password: ${{ secrets.EULIX_REGISTRY_PASSWORD }}
#
# - name: Log into registry Docker Hub
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SH }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_SH }}
# username: cn-east-3@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_BJ }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_BJ }}
# username: cn-north-4@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_GZ }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_GZ }}
# username: cn-south-1@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SG }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_SG }}
# username: ap-southeast-3@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_HK }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_HK }}
# username: ap-southeast-1@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_AF }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_AF }}
# username: af-south-1@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_LA }}
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ${{ env.HUAWEICLOUD_REGISTRY_LA }}
# username: la-north-2@${{ secrets.HUAWEICLOUD_USERNAME }}
# password: ${{ secrets.HUAWEICLOUD_PASSWORD }}
#
# - name: Extract Docker metadata for Server
# id: meta-server
# uses: docker/metadata-action@v2
# with:
# images: |
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }}
# aospace/${{ env.GITHUB_REPOSITORY_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }}
# flavor: |
# prefix=server-
#
# - name: Build and push Docker image for Server
# id: build-and-push-server
# uses: docker/build-push-action@v4.2.1
# with:
# context: .
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta-server.outputs.tags }}
# labels: ${{ steps.meta-server.outputs.labels }}
# builder: ${{ steps.buildx.outputs.name }}
# platforms: linux/amd64,linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# file: Dockerfile-server
# provenance: false
#
# - name: Extract Docker metadata for Client
# id: meta-client
# uses: docker/metadata-action@v2
# with:
# images: |
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }}
# aospace/${{ env.GITHUB_REPOSITORY_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }}
# ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }}
# flavor: |
# prefix=client-
#
# - name: Build and push Docker image for Client
# id: build-and-push-client
# uses: docker/build-push-action@v4.2.1
# with:
# context: .
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta-client.outputs.tags }}
# labels: ${{ steps.meta-client.outputs.labels }}
# builder: ${{ steps.buildx.outputs.name }}
# platforms: linux/amd64,linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# file: Dockerfile-client
# provenance: false
#
# - name: Extract Docker metadata for Server
# id: meta-opensource-server
# uses: docker/metadata-action@v2
# with:
# images: |
# ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-server
# flavor: |
# prefix=opensource-server-
#
# - name: Build and push Docker image for Server
# id: build-and-push-opensource-server
# uses: docker/build-push-action@v2
# with:
# context: .
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta-opensource-server.outputs.tags }}
# labels: ${{ steps.meta-opensource-server.outputs.labels }}
# builder: ${{ steps.buildx.outputs.name }}
# platforms: linux/amd64,linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# file: Dockerfile-server
#
# - name: Extract Docker metadata for Client
# id: meta-opensource-client
# uses: docker/metadata-action@v2
# with:
# images: |
# ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-client
# flavor: |
# prefix=opensource-client-
#
# - name: Build and push Docker image for Client
# id: build-and-push-opensource-client
# uses: docker/build-push-action@v2
# with:
# context: .
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta-opensource-client.outputs.tags }}
# labels: ${{ steps.meta-opensource-client.outputs.labels }}
# builder: ${{ steps.buildx.outputs.name }}
# platforms: linux/amd64,linux/arm64
# cache-from: type=gha
# cache-to: type=gha,mode=max
# file: Dockerfile-client