Repository navigation
146 lines (138 loc) · 5.12 KB
/
Copy pathbuild-images.apko.yaml
File metadata and controls
146 lines (138 loc) · 5.12 KB
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
# Stage 1: plan -> melange matrix from .github/images.apko.json
# Stage 2: apko matrix from same image config.
# Stage 3: smoke test matrix from image smoke_test entries.
name: build-images.apko
on:
push:
branches:
- develop
tags:
- "*/v*"
- "op-reth/bench*"
pull_request:
branches:
- develop
# Mirror the (now-disabled) docker build-images.yaml triggers: build on the
# same source changes, with docker-specific paths swapped for apko ones.
paths:
- "op-*/**"
- "cannon/**"
- "packages/contracts-bedrock/**"
- "rust/**"
- "ops/scripts/compute-git-versions.sh"
- "go.mod"
- "go.sum"
- ".github/workflows/build-images.apko.yaml"
- ".github/images.apko.json"
- "apko/**"
- "melange/**"
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
concurrency:
# Tag pushes get a group per tag: a release commonly tags several components on
# one commit, and each tag builds a different image, so they must not share a
# group -- GitHub keeps only one waiting run per group and evicts the rest.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || (github.ref_type == 'tag' && format('{0}-{1}', github.sha, github.ref_name) || github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
SOURCE_DATE_EPOCH: 0
REGISTRY: us-docker.pkg.dev/oplabs-tools-artifacts/images
jobs:
plan:
name: plan
runs-on: ubuntu-slim
permissions:
contents: read
outputs:
melange_matrix_json: ${{ steps.plan.outputs.melange_matrix_json }}
apko_matrix_json: ${{ steps.plan.outputs.apko_matrix_json }}
smoke_matrix_json: ${{ steps.plan.outputs.smoke_matrix_json }}
has_builds: ${{ steps.plan.outputs.has_builds }}
is_release: ${{ steps.plan.outputs.is_release }}
steps:
- name: Checkout repository
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v6
with:
fetch-depth: 0
ref: ${{ github.event_name == 'schedule' && 'develop' || '' }}
- name: Plan melange, apko, and smoke matrices
id: plan
uses: ethereum-optimism/factory/actions/apko-plan@8e1089eda9118f3589019bf9fd9304e2860986ff
with:
config: .github/images.apko.json
melange:
name: melange (${{ matrix.stack }}, ${{ matrix.arch }})
needs: plan
if: needs.plan.outputs.has_builds == 'true' && needs.plan.outputs.melange_matrix_json != '[]'
strategy:
fail-fast: true
matrix:
include: ${{ fromJson(needs.plan.outputs.melange_matrix_json) }}
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
uses: ethereum-optimism/factory/.github/workflows/melange-build.yaml@b71bfb27995c67852e5337a91ce7f3e5faa22f39
with:
stack: ${{ matrix.stack }}
arch: ${{ matrix.arch }}
runner-profile: ${{ matrix.runner_profile }}
melange-config: ${{ matrix.melange_config }}
source-repository: ${{ matrix.source_repository }}
source-ref: ${{ matrix.source_ref }}
source-path: ${{ matrix.source_path }}
checkout-source: ${{ matrix.checkout_source }}
source-submodules: ${{ matrix.source_submodules }}
use-gha-cache: ${{ matrix.use_gha_cache }}
cache-key-files: ${{ matrix.cache_key_files }}
cargo-profile: ${{ github.event_name == 'pull_request' && 'fast-build' || 'maxperf' }}
build-version: ${{ matrix.build_version }}
apko:
name: apko (${{ matrix.service }})
needs: [plan, melange]
if: |
always() &&
needs.plan.outputs.has_builds == 'true' &&
(needs.melange.result == 'success' || needs.melange.result == 'skipped')
strategy:
fail-fast: true
matrix:
include: ${{ fromJson(needs.plan.outputs.apko_matrix_json) }}
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
actions: read
uses: ethereum-optimism/factory/.github/workflows/apko-publish.yaml@b71bfb27995c67852e5337a91ce7f3e5faa22f39
with:
service: ${{ matrix.service }}
needs-melange-apks: ${{ matrix.needs_melange_apks }}
registry: us-docker.pkg.dev/oplabs-tools-artifacts/images
publish-tag: ${{ matrix.publish_tag }}
archs: ${{ matrix.archs }}
smoke-test:
name: smoke test (${{ matrix.service }}, ${{ matrix.arch }})
needs: [plan, apko]
if: |
always() &&
needs.plan.outputs.has_builds == 'true' &&
needs.plan.outputs.smoke_matrix_json != '[]' &&
needs.apko.result == 'success'
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.plan.outputs.smoke_matrix_json) }}
permissions:
contents: read
id-token: write
uses: ethereum-optimism/factory/.github/workflows/apko-smoke-test.yaml@b71bfb27995c67852e5337a91ce7f3e5faa22f39
with:
service: ${{ matrix.service }}
registry: us-docker.pkg.dev/oplabs-tools-artifacts/images
arch: ${{ matrix.arch }}
runner: ${{ matrix.runner }}
smoke-test: ${{ matrix.smoke_test }}
expected-version: ${{ matrix.expected_version }}