-
Notifications
You must be signed in to change notification settings - Fork 21
204 lines (193 loc) · 7.62 KB
/
Copy pathrelease_nightly.yml
File metadata and controls
204 lines (193 loc) · 7.62 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
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
name: release nightly
on:
schedule:
- cron: "15 20 * * *" # 20:15 UTC, every day
workflow_dispatch: {}
env:
container_registry: ghcr.io/edgelesssys
DO_NOT_TRACK: 1
concurrency:
group: release-nightly
cancel-in-progress: true
jobs:
process-inputs:
name: Process inputs
runs-on: ubuntu-24.04
permissions:
contents: read
outputs:
EFFECTIVE_VERSION: ${{ steps.nightly-version.outputs.value }}
WITHOUT_V: ${{ steps.version-info.outputs.without_v }}
RELEASE_BRANCH: ${{ steps.version-info.outputs.release_branch }}
WORKING_BRANCH: ${{ steps.branch.outputs.value }}
PREVIOUS_MINOR_TAG: ${{ steps.version-info.outputs.previous_minor_tag }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-tags: true
- name: Get working branch
id: branch
run: echo "value=$(git branch --show-current)" >> "$GITHUB_OUTPUT"
- name: Determine nightly version
id: nightly-version
run: |
base=$(sed 's/-.*$//' version.txt)
echo "value=v${base}-$(date -u +%Y-%m-%d)" >> "$GITHUB_OUTPUT"
- name: Parse version
id: version-info
uses: ./.github/actions/parse_version
with:
version: ${{ steps.nightly-version.outputs.value }}
cleanup-nightly-drafts:
name: Clean up old nightly draft releases
runs-on: ubuntu-24.04
needs: process-inputs
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Delete existing nightly draft releases
env:
GH_REPO: ${{ github.repository }}
run: |
gh release list --repo "${GH_REPO}" --limit 10 --json tagName,isDraft \
| jq -r '.[] | select(.isDraft == true) | .tagName' \
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-[0-9]{4}-[0-9]{2}-[0-9]{2}$' \
| while IFS= read -r nightly_version; do
echo "Deleting nightly draft release: ${nightly_version}"
gh release delete "${nightly_version}" --repo "${GH_REPO}" --yes
done
release-x86_64-linux:
name: "release-requirement: Build and push artifacts, create nightly draft release"
runs-on: ubuntu-24.04
needs: [process-inputs, cleanup-nightly-drafts]
permissions:
contents: write
packages: write
id-token: write
outputs:
LOG_COLLECTOR_IMAGE: ${{ steps.build.outputs.log_collector_image }}
ARTIFACTS_URL: ${{ steps.build.outputs.s3-bucket-url }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ needs.process-inputs.outputs.WORKING_BRANCH }}
persist-credentials: false
- uses: ./.github/actions/release_build_linux
id: build
with:
effective_version: ${{ needs.process-inputs.outputs.EFFECTIVE_VERSION }}
without_v: ${{ needs.process-inputs.outputs.WITHOUT_V }}
working_branch: ${{ needs.process-inputs.outputs.WORKING_BRANCH }}
container_registry: ${{ env.container_registry }}
previous_tag: ${{ needs.process-inputs.outputs.PREVIOUS_MINOR_TAG }}
github_token: ${{ secrets.GITHUB_TOKEN }}
cachix_token: ${{ secrets.CACHIX_AUTH_TOKEN }}
release-aarch64-darwin:
name: "release-requirement: Build aarch64-darwin CLI"
runs-on: macos-latest
needs: [process-inputs, release-x86_64-linux]
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ needs.process-inputs.outputs.WORKING_BRANCH }}
persist-credentials: false
- uses: ./.github/actions/release_build_darwin
with:
effective_version: ${{ needs.process-inputs.outputs.EFFECTIVE_VERSION }}
without_v: ${{ needs.process-inputs.outputs.WITHOUT_V }}
github_token: ${{ secrets.GITHUB_TOKEN }}
cachix_token: ${{ secrets.CACHIX_AUTH_TOKEN }}
report-artifacts:
name: Pre-release artifacts
needs: [release-x86_64-linux, release-aarch64-darwin]
permissions: {}
uses: ./.github/workflows/report_artifacts.yml
with:
url: ${{ needs.release-x86_64-linux.outputs.ARTIFACTS_URL }}
vuln-scan:
name: "dependency vulnerability scan"
uses: ./.github/workflows/vuln_scan.yml
secrets:
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
permissions:
contents: read
security-events: write
nightly:
name: "release-requirement: e2e nightly"
uses: ./.github/workflows/e2e_nightly.yml
secrets:
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
NUNKI_CI_COMMIT_PUSH_PR: ${{ secrets.NUNKI_CI_COMMIT_PUSH_PR }}
TEAMS_CI_WEBHOOK: ${{ secrets.TEAMS_CI_WEBHOOK }}
CONTRAST_GHCR_READ: ${{ secrets.CONTRAST_GHCR_READ }}
permissions:
contents: read
packages: write
test:
strategy:
matrix:
platform:
- name: Metal-QEMU-SNP
node-installer-target-conf: none
linux-runner: SNP
is-public: true
- name: Metal-QEMU-SNP-GPU
node-installer-target-conf: k3s
linux-runner: SNP-GPU
is-public: false
- name: Metal-QEMU-TDX
node-installer-target-conf: k3s
linux-runner: TDX
is-public: false
- name: Metal-QEMU-TDX-GPU
node-installer-target-conf: none
linux-runner: TDX-GPU
is-public: true
cli-arch:
- x86_64-linux
- aarch64-darwin
fail-fast: false
name: "release-requirement: e2e release on ${{ matrix.platform.name }} (${{ matrix.cli-arch }})"
runs-on: ${{ matrix.cli-arch == 'aarch64-darwin' && 'macos-latest' || matrix.platform.linux-runner }}
# Serialize matrix entries that share a cluster (linux + darwin) to
# avoid clashing on coordinator state and resource cleanup.
concurrency:
group: e2e-release-${{ matrix.platform.name }}-${{ github.run_id }}
cancel-in-progress: false
permissions:
contents: read
packages: read
# Needed for GH OIDC -> GCP WIF federation on the darwin entries.
id-token: write
needs: [process-inputs, release-x86_64-linux, release-aarch64-darwin, nightly]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ needs.process-inputs.outputs.WORKING_BRANCH }}
persist-credentials: false
- uses: ./.github/actions/release_e2e_test
with:
version: ${{ needs.process-inputs.outputs.EFFECTIVE_VERSION }}
s3_base_url: ${{ needs.release-x86_64-linux.outputs.ARTIFACTS_URL }}
container_registry: ${{ env.container_registry }}
platform_name: ${{ matrix.platform.name }}
node_installer_target_conf: ${{ matrix.platform.node-installer-target-conf }}
self_hosted: ${{ matrix.cli-arch == 'x86_64-linux' }}
cli_arch: ${{ matrix.cli-arch }}
is_public: ${{ matrix.platform.is-public }}
github_token: ${{ secrets.GITHUB_TOKEN }}
cachix_token: ${{ secrets.CACHIX_AUTH_TOKEN }}
wif_provider: ${{ vars.GCP_WIF_PROVIDER }}
sa_email: ${{ vars.GCP_SA_EMAIL }}
tailscale_client_id: ${{ secrets.TAILSCALE_CLIENT_ID }}
tailscale_client_secret: ${{ secrets.TAILSCALE_CLIENT_SECRET }}
log_collector_image: ${{ needs.release-x86_64-linux.outputs.LOG_COLLECTOR_IMAGE }}