forked from GitTools/build-images
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (108 loc) · 4.68 KB
/
build-images.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
name: Build Images
on:
workflow_dispatch:
# workflow_run:
# workflows: [ Build Deps ]
# types:
# - completed
jobs:
prepare:
name: Prepare Build
runs-on: ubuntu-24.04
outputs:
dockerDistros: ${{ steps.set_matrix.outputs.dockerDistros }}
dotnetVersions: ${{ steps.set_matrix.outputs.dotnetVersions }}
dotnetVariants: ${{ steps.set_matrix.outputs.dotnetVariants }}
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
# with:
# ref: ${{ github.event.workflow_run.head_branch }}
- name: Cache cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: build/global.json
- name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
run: dotnet build build/CI.sln --configuration=Release
- name: '[Matrix]'
id: set_matrix
run: dotnet run/build.dll --target=SetMatrix
build_images:
name: Build Images (${{ matrix.arch }} - ${{ matrix.dotnet_variant }})
needs: [ prepare ]
strategy:
fail-fast: false
matrix:
arch: [ amd64, arm64 ]
runner: [ ubuntu-24.04, ubuntu-24.04-arm ]
dotnet_variant: ${{ fromJson(needs.prepare.outputs.dotnetVariants) }}
exclude:
- runner: ubuntu-24.04-arm
arch: amd64
- runner: ubuntu-24.04
arch: arm64
uses: ./.github/workflows/_build-images.yml
with:
runner: ${{ matrix.runner }}
arch: ${{ matrix.arch }}
dotnet_variant: ${{ matrix.dotnet_variant }}
dotnet_versions: ${{ needs.prepare.outputs.dotnetVersions }}
docker_distros: ${{ needs.prepare.outputs.dockerDistros }}
# build_images_manifest:
# name: Build Images (${{ matrix.distro }}) (${{ matrix.version }} - ${{ matrix.variant }})
# needs: [ prepare, build_images ]
# env:
# PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
# runs-on: ubuntu-24.04
# strategy:
# matrix:
# distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
# version: ${{ fromJson(needs.prepare.outputs.dotnetVersions) }}
# variant: ${{ fromJson(needs.prepare.outputs.dotnetVariants) }}
# fail-fast: false
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.workflow_run.head_branch }}
# - name: Use cached cake frosting
# id: cache-cake
# uses: actions/cache@v4
# with:
# path: run
# key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
# - name: Setup .NET SDK
# uses: actions/setup-dotnet@v4
# with:
# global-json-file: build/global.json
# - name: Set up Docker
# uses: ./.github/actions/docker-setup
# - name: Publish image manifest to DockerHub
# uses: ./.github/actions/build-images-manifest
# with:
# dotnet_version: ${{ matrix.version }}
# dotnet_variant: ${{ matrix.variant }}
# docker_distro: ${{ matrix.distro }}
# docker_registry: docker.io
# docker_registry_name: dockerhub
# docker_registry_username: ${{ secrets.DOCKER_USERNAME }}
# docker_registry_password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Publish image manifest to GitHub
# uses: ./.github/actions/build-images-manifest
# with:
# dotnet_version: ${{ matrix.version }}
# dotnet_variant: ${{ matrix.variant }}
# docker_distro: ${{ matrix.distro }}
# docker_registry: ghcr.io
# docker_registry_name: github
# docker_registry_username: ${{ github.repository_owner }}
# docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }}