Skip to content

Commit

Permalink
fix(ci): remove footguns.
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed Nov 30, 2024
1 parent 7cacb82 commit d8448cf
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 55 deletions.
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 "${{ env.ISO_UPLOAD_DIR }}/${iso_name}" "${{ env.ISO_UPLOAD_DIR}}/${asus_name}"
mv "${{ env.ISO_UPLOAD_DIR }}/${iso_name}-CHECKSUM" "${{ env.ISO_UPLOAD_DIR}}/${asus_name}-CHECKSUM"
cp "${{ env.ISO_UPLOAD_DIR }}/${asus_name}" "${{ env.ISO_UPLOAD_DIR}}/${surface_name}"
cp "${{ env.ISO_UPLOAD_DIR }}/${asus_name}-CHECKSUM" "${{ env.ISO_UPLOAD_DIR}}/${surface_name}-CHECKSUM"
tree "${{ env.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

0 comments on commit d8448cf

Please sign in to comment.