Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): remove footguns. #1992

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/changelogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,18 @@ def get_manifests(target: str):
def get_tags(target: str, manifests: dict[str, Any]):
tags = set()

first = next(iter(manifests.values()))
for tag in first["RepoTags"]:
# Tags ending with .0 should not exist
if tag.endswith(".0"):
continue
if re.match(START_PATTERN(target), tag):
tags.add(tag)

for manifest in manifests.values():
for tag in manifest["RepoTags"]:
# Tags ending with .0 should not exist
if tag.endswith(".0"):
continue
if re.match(START_PATTERN(target), tag):
tags.add(tag)
for tag in list(tags):
if tag not in manifest["RepoTags"]:
tags.remove(tag)

tags = list(sorted(tags))
if not len(tags) >= 2:
Expand Down Expand Up @@ -391,6 +396,11 @@ def generate_changelog(

changelog = CHANGELOG_FORMAT

if target == "gts":
changelog = changelog.splitlines()
del changelog[9]
changelog = '\n'.join(changelog)

changelog = (
changelog.replace("{handwritten}", handwritten if handwritten else HANDWRITTEN_PLACEHOLDER)
.replace("{target}", target)
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/build-image-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ on:
- cron: "40 4 * * 0" # 4:40 UTC Sunday
workflow_call:
workflow_dispatch:
inputs:
brand_name:
description: "Image Brand to Build"
default: '["bluefin"]'
type: choice
options:
- '["bluefin"]'
- '["aurora"]'
- '["bluefin", "aurora"]'

jobs:
build-image-beta:
Expand All @@ -30,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
brand_name: ${{ fromJson(inputs.brand_name || '["bluefin", "aurora"]') }}
brand_name: ["bluefin", "aurora"]
with:
brand_name: ${{ matrix.brand_name }}
stream_name: beta
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/build-image-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ on:
- cron: "40 4 * * 0" # 4:40 UTC Sunday
workflow_call:
workflow_dispatch:
inputs:
brand_name:
description: "Image Brand to Build"
default: '["bluefin"]'
type: choice
options:
- '["bluefin"]'
- '["aurora"]'
- '["bluefin", "aurora"]'

jobs:
build-image-latest:
Expand All @@ -30,11 +21,12 @@ jobs:
strategy:
fail-fast: false
matrix:
brand_name: ${{ fromJson(inputs.brand_name || '["bluefin", "aurora"]') }}
brand_name: ["bluefin", "aurora"]
with:
image_flavors: '["main", "nvidia", "hwe", "hwe-nvidia"]'
brand_name: ${{ matrix.brand_name }}
stream_name: latest
# This needs splitting, right now a kernel pin will not work due to hwe kernel

generate-release:
name: Generate Release
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/build-image-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ on:
- cron: "45 5 * * 0" # 5:41 UTC sunday
workflow_call:
workflow_dispatch:
inputs:
brand_name:
description: "Image Brand to Build"
default: '["bluefin"]'
type: choice
options:
- '["bluefin"]'
- '["aurora"]'
- '["bluefin", "aurora"]'

jobs:
build-image-stable:
Expand All @@ -30,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
brand_name: ${{ fromJson(inputs.brand_name || '["bluefin", "aurora"]') }}
brand_name: ["bluefin", "aurora"]
with:
kernel_pin: 6.11.3-300.fc41.x86_64
brand_name: ${{ matrix.brand_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-iso-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
matrix:
brand_name: ${{ fromJson(inputs.brand_name || '["bluefin", "aurora"]') }}
with:
image_flavors: '["main", "nvidia", "asus", "asus-nvidia", "surface", "surface-nvidia"]'
image_flavors: '["main", "nvidia", "hwe", "hwe-nvidia"]'
brand_name: ${{ matrix.brand_name }}
stream_name: latest
20 changes: 2 additions & 18 deletions .github/workflows/generate-release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
on:
workflow_call:
inputs:
make_latest:
description: "Make latest for Release"
type: string
default: 'False'
stream_name:
description: "Release Tag (e.g. gts, stable)"
type: string
Expand All @@ -13,13 +9,6 @@ on:
inputs:
handwritten:
description: "Small Changelog about changes in this build"
make_latest:
description: "Make latest for Release"
type: choice
default: 'False'
options:
- 'False'
- 'True'
stream_name:
description: "Release Tag (e.g. gts, stable)"
required: true
Expand All @@ -28,11 +17,6 @@ on:
- '["gts", "stable"]'
- '["gts"]'
- '["stable"]'
# - '["stable-daily"]'
# - '["latest"]'
# - '["beta"]'
# - '["stable-daily", "latest", "beta"]'
# - '["gts", "stable", "stable-daily", "latest", "beta"]'

permissions:
contents: write
Expand Down Expand Up @@ -83,5 +67,5 @@ jobs:
name: ${{ steps.generate-release-text.outputs.title }}
tag_name: ${{ steps.generate-release-text.outputs.tag }}
body_path: ./changelog.md
make_latest: ${{ inputs.make_latest == 'True' && matrix.version == 'stable' || false }}
prerelease: ${{ inputs.make_latest != 'True' }}
make_latest: ${{ matrix.version == 'stable' }}
prerelease: ${{ matrix.version != 'stable' }}
14 changes: 14 additions & 0 deletions .github/workflows/reusable-build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ jobs:
retention-days: 0
compression-level: 0
overwrite: true

- name: HWE ISO rename
if: contains(matrix.image_flavor, 'hwe')
shell: bash
run: |
set -eoux pipefail
iso_name="${{ env.ISO_NAME }}"
asus_name="${iso_name/hwe/asus}"
surface_name="${iso_name/hwe/surface}"
mv "${{ steps.upload-directory.outputs.iso-upload-dir }}/${iso_name}" "${{ steps.upload-directory.outputs.iso-upload-dir}}/${asus_name}"
mv "${{ steps.upload-directory.outputs.iso-upload-dir }}/${iso_name}-CHECKSUM" "${{ steps.upload-directory.outputs.iso-upload-dir}}/${asus_name}-CHECKSUM"
cp "${{ steps.upload-directory.outputs.iso-upload-dir }}/${asus_name}" "${{ steps.upload-directory.outputs.iso-upload-dir}}/${surface_name}"
cp "${{ steps.upload-directory.outputs.iso-upload-dir }}/${asus_name}-CHECKSUM" "${{ steps.upload-directory.outputs.iso-upload-dir}}/${surface_name}-CHECKSUM"
tree "${{ steps.upload-directory.outputs.iso-upload-dir }}"

- name: Upload ISOs and Checksum to R2 to Bluefin Bucket
if: github.ref_name == 'main' && contains(matrix.base_name,'bluefin')
Expand Down