Skip to content

Commit 02ebe73

Browse files
authored
Merge pull request #48 from GitTools/feature/arm64
Use ARM64 linux runners
2 parents 592c0c4 + 42dcc2b commit 02ebe73

11 files changed

+405
-231
lines changed

.github/workflows/build-deps.yml

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,21 @@ jobs:
4040
run: dotnet run/build.dll --target=SetMatrix
4141

4242
build_deps:
43-
name: Deps
43+
name: Build Deps (${{ matrix.arch }} - ${{ matrix.distro }})
4444
needs: [ prepare ]
4545
env:
4646
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
47-
runs-on: ubuntu-24.04
47+
runs-on: ${{ matrix.runner }}
4848
strategy:
4949
matrix:
50+
arch: [ amd64, arm64 ]
51+
runner: [ ubuntu-24.04, ubuntu-24.04-arm ]
5052
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
53+
exclude:
54+
- runner: ubuntu-24.04-arm
55+
arch: amd64
56+
- runner: ubuntu-24.04
57+
arch: arm64
5158
fail-fast: false
5259
steps:
5360
- name: Checkout
@@ -66,8 +73,6 @@ jobs:
6673
uses: docker/setup-docker-action@v4
6774
with:
6875
daemon-config: '{ "features": { "containerd-snapshotter": true } }'
69-
- name: Setup QEMU
70-
uses: docker/setup-qemu-action@v3
7176
- name: Setup Docker Buildx
7277
uses: docker/setup-buildx-action@v3
7378
with:
@@ -80,20 +85,85 @@ jobs:
8085
with:
8186
username: ${{ secrets.DOCKER_USERNAME }}
8287
password: ${{ secrets.DOCKER_PASSWORD }}
83-
84-
- name: '[Build Docker images]'
88+
- name: '[Build Docker images] DockerHub'
89+
shell: pwsh
90+
run: |
91+
dotnet run/build.dll `
92+
--target=DockerBuildDeps --arch=${{ matrix.arch }} `
93+
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
94+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
95+
- name: Login to GitHub Container Registry
96+
if: success() && env.PUSH_IMAGES == 'true'
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ghcr.io
100+
username: ${{ github.repository_owner }}
101+
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
102+
- name: '[Build Docker images] GitHub'
85103
shell: pwsh
86-
run: dotnet run/build.dll --target=DockerBuildDeps --dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
87-
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
104+
run: |
105+
dotnet run/build.dll `
106+
--target=DockerBuildDeps --arch=${{ matrix.arch }} `
107+
--dotnet_distro=${{ matrix.distro }} --docker_registry=github `
108+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
88109
110+
build_deps_manifests:
111+
name: Build Deps Manifests (${{ matrix.distro }})
112+
needs: [ prepare, build_deps ]
113+
env:
114+
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
115+
runs-on: ubuntu-24.04
116+
strategy:
117+
matrix:
118+
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
119+
fail-fast: false
120+
steps:
121+
- name: Checkout
122+
uses: actions/checkout@v4
123+
- name: Use cached cake frosting
124+
id: cache-cake
125+
uses: actions/cache@v4
126+
with:
127+
path: run
128+
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
129+
- name: Setup .NET SDK
130+
uses: actions/setup-dotnet@v4
131+
with:
132+
global-json-file: build/global.json
133+
- name: Set up Docker
134+
uses: docker/setup-docker-action@v4
135+
with:
136+
daemon-config: '{ "features": { "containerd-snapshotter": true } }'
137+
- name: Setup Docker Buildx
138+
uses: docker/setup-buildx-action@v3
139+
with:
140+
version: 'latest'
141+
driver-opts: 'image=moby/buildkit:buildx-stable-1'
142+
install: true
143+
- name: Login to DockerHub
144+
if: success() && env.PUSH_IMAGES == 'true'
145+
uses: docker/login-action@v3
146+
with:
147+
username: ${{ secrets.DOCKER_USERNAME }}
148+
password: ${{ secrets.DOCKER_PASSWORD }}
149+
- name: '[Build Docker manifests] DockerHub'
150+
shell: pwsh
151+
run: |
152+
dotnet run/build.dll `
153+
--target=DockerBuildDepsManifest `
154+
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
155+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
89156
- name: Login to GitHub Container Registry
90157
if: success() && env.PUSH_IMAGES == 'true'
91158
uses: docker/login-action@v3
92159
with:
93160
registry: ghcr.io
94161
username: ${{ github.repository_owner }}
95162
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
96-
- name: '[Build Docker images]'
163+
- name: '[Build Docker manifests] GitHub'
97164
shell: pwsh
98-
run: dotnet run/build.dll --target=DockerBuildDeps --dotnet_distro=${{ matrix.distro }} --docker_registry=github `
99-
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
165+
run: |
166+
dotnet run/build.dll `
167+
--target=DockerBuildDepsManifest `
168+
--dotnet_distro=${{ matrix.distro }} --docker_registry=github `
169+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic

.github/workflows/build-images.yml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Build Images
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: [ Build Deps ]
7+
types:
8+
- completed
9+
jobs:
10+
prepare:
11+
name: Prepare Build
12+
runs-on: ubuntu-24.04
13+
outputs:
14+
dockerDistros: ${{ steps.set_matrix.outputs.dockerDistros }}
15+
dotnetVersions: ${{ steps.set_matrix.outputs.dotnetVersions }}
16+
dotnetVariants: ${{ steps.set_matrix.outputs.dotnetVariants }}
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.workflow_run.head_branch }}
23+
- name: Cache cake frosting
24+
id: cache-cake
25+
uses: actions/cache@v4
26+
with:
27+
path: run
28+
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
29+
- name: Setup .NET SDK
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
global-json-file: build/global.json
33+
- name: '[Prepare]'
34+
if: steps.cache-cake.outputs.cache-hit != 'true'
35+
run: dotnet build build/CI.sln --configuration=Release
36+
- name: '[Matrix]'
37+
id: set_matrix
38+
run: dotnet run/build.dll --target=SetMatrix
39+
40+
build_images:
41+
name: Build Images (${{ matrix.arch }} - ${{ matrix.distro }}) (${{ matrix.version }} - ${{ matrix.variant }})
42+
needs: [ prepare ]
43+
env:
44+
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
45+
runs-on: ${{ matrix.runner }}
46+
strategy:
47+
matrix:
48+
arch: [ amd64, arm64 ]
49+
runner: [ ubuntu-24.04, ubuntu-24.04-arm ]
50+
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
51+
version: ${{ fromJson(needs.prepare.outputs.dotnetVersions) }}
52+
variant: ${{ fromJson(needs.prepare.outputs.dotnetVariants) }}
53+
exclude:
54+
- runner: ubuntu-24.04-arm
55+
arch: amd64
56+
- runner: ubuntu-24.04
57+
arch: arm64
58+
fail-fast: false
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
with:
64+
ref: ${{ github.event.workflow_run.head_branch }}
65+
- name: Use cached cake frosting
66+
id: cache-cake
67+
uses: actions/cache@v4
68+
with:
69+
path: run
70+
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
71+
- name: Setup .NET SDK
72+
uses: actions/setup-dotnet@v4
73+
with:
74+
global-json-file: build/global.json
75+
- name: Set up Docker
76+
uses: docker/setup-docker-action@v4
77+
with:
78+
daemon-config: '{ "features": { "containerd-snapshotter": true } }'
79+
- name: Setup Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
with:
82+
version: 'latest'
83+
driver-opts: 'image=moby/buildkit:buildx-stable-1'
84+
install: true
85+
- name: Login to DockerHub
86+
if: success() && env.PUSH_IMAGES == 'true'
87+
uses: docker/login-action@v3
88+
with:
89+
username: ${{ secrets.DOCKER_USERNAME }}
90+
password: ${{ secrets.DOCKER_PASSWORD }}
91+
- name: '[Build Docker images]'
92+
shell: pwsh
93+
run: |
94+
dotnet run/build.dll `
95+
--target=DockerBuildImages --arch=${{ matrix.arch }} `
96+
--dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} `
97+
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
98+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
99+
- name: Login to GitHub Container Registry
100+
if: success() && env.PUSH_IMAGES == 'true'
101+
uses: docker/login-action@v3
102+
with:
103+
registry: ghcr.io
104+
username: ${{ github.repository_owner }}
105+
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
106+
- name: '[Build Docker images]'
107+
shell: pwsh
108+
run: |
109+
dotnet run/build.dll `
110+
--target=DockerBuildImages --arch=${{ matrix.arch }} `
111+
--dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} `
112+
--dotnet_distro=${{ matrix.distro }} --docker_registry=github `
113+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
114+
115+
build_images_manifest:
116+
name: Build Images (${{ matrix.distro }}) (${{ matrix.version }} - ${{ matrix.variant }})
117+
needs: [ prepare, build_images ]
118+
env:
119+
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
120+
runs-on: ubuntu-24.04
121+
strategy:
122+
matrix:
123+
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
124+
version: ${{ fromJson(needs.prepare.outputs.dotnetVersions) }}
125+
variant: ${{ fromJson(needs.prepare.outputs.dotnetVariants) }}
126+
fail-fast: false
127+
128+
steps:
129+
- name: Checkout
130+
uses: actions/checkout@v4
131+
with:
132+
ref: ${{ github.event.workflow_run.head_branch }}
133+
- name: Use cached cake frosting
134+
id: cache-cake
135+
uses: actions/cache@v4
136+
with:
137+
path: run
138+
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
139+
- name: Setup .NET SDK
140+
uses: actions/setup-dotnet@v4
141+
with:
142+
global-json-file: build/global.json
143+
- name: Set up Docker
144+
uses: docker/setup-docker-action@v4
145+
with:
146+
daemon-config: '{ "features": { "containerd-snapshotter": true } }'
147+
- name: Setup Docker Buildx
148+
uses: docker/setup-buildx-action@v3
149+
with:
150+
version: 'latest'
151+
driver-opts: 'image=moby/buildkit:buildx-stable-1'
152+
install: true
153+
- name: Login to DockerHub
154+
if: success() && env.PUSH_IMAGES == 'true'
155+
uses: docker/login-action@v3
156+
with:
157+
username: ${{ secrets.DOCKER_USERNAME }}
158+
password: ${{ secrets.DOCKER_PASSWORD }}
159+
- name: '[Build Docker images]'
160+
shell: pwsh
161+
run: |
162+
dotnet run/build.dll `
163+
--target=DockerBuildImagesManifest `
164+
--dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} `
165+
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
166+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
167+
- name: Login to GitHub Container Registry
168+
if: success() && env.PUSH_IMAGES == 'true'
169+
uses: docker/login-action@v3
170+
with:
171+
registry: ghcr.io
172+
username: ${{ github.repository_owner }}
173+
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
174+
- name: '[Build Docker images]'
175+
shell: pwsh
176+
run: |
177+
dotnet run/build.dll `
178+
--target=DockerBuildImagesManifest `
179+
--dotnet_version=${{ matrix.version }} --dotnet_variant=${{ matrix.variant }} `
180+
--dotnet_distro=${{ matrix.distro }} --docker_registry=github `
181+
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic

0 commit comments

Comments
 (0)