Build Bluefin ISOs #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Bluefin ISOs | |
on: | |
workflow_dispatch: | |
workflow_call: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-iso | |
cancel-in-progress: true | |
jobs: | |
build-iso: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
strategy: | |
fail-fast: false | |
matrix: | |
image_name: | |
- bluefin | |
- bluefin-nvidia | |
- bluefin-asus | |
- bluefin-asus-nvidia | |
- bluefin-surface | |
- bluefin-surface-nvidia | |
- bluefin-dx | |
- bluefin-dx-nvidia | |
- bluefin-dx-asus | |
- bluefin-dx-surface | |
- bluefin-dx-asus-nvidia | |
- bluefin-dx-surface-nvidia | |
major_version: [38, 39] | |
exclude: | |
- major_version: 38 | |
image_name: bluefin-asus | |
- major_version: 38 | |
image_name: bluefin-asus-nvidia | |
- major_version: 38 | |
image_name: bluefin-dx-asus | |
- major_version: 38 | |
image_name: bluefin-dx-asus-nvidia | |
include: | |
- major_version: 38 | |
is_gts_version: true | |
- major_version: 39 | |
is_gts_version: false | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/[email protected] | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Set Image Tag | |
id: generate-tag | |
shell: bash | |
run: | | |
TAG="latest" | |
if [[ ${{ matrix.is_gts_version }} == "true" ]]; then | |
TAG="gts" | |
fi | |
if [[ "${{ github.ref_name }}" == "testing" ]]; then | |
if [[ "${{ matrix.is_gts_version }}" == "true" ]]; then | |
TAG="gts-testing" | |
else | |
TAG="testing" | |
fi | |
fi | |
# Would like to implement in the future. This will allow us to support image tags from a PR. | |
#if [[ github.event.number ]]; then | |
# TAG="pr-${{ github.event.number }}-${{ matrix.major_version }}" | |
#fi | |
echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
- name: Determine Flatpak Dependencies | |
id: flatpak_dependencies | |
uses: jasonn3/build-container-installer@deps | |
with: | |
arch: x86_64 | |
image_name: ${{ matrix.image_name }} | |
image_repo: ghcr.io/ublue-os | |
variant: 'Silverblue' | |
version: ${{ matrix.major_version }} | |
image_tag: ${{ steps.generate-tag.outputs.tag }} | |
secure_boot_key_url: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' | |
enrollment_password: 'ublue-os' | |
make_target: flatpaks/full_list | |
enable_cache_dnf: "false" | |
enable_cache_skopeo: "false" | |
flatpak_remote_refs_dir: flatpaks | |
- name: Filter Flatpak list | |
id: filtered_flatpak_dependencies | |
shell: bash | |
run: | | |
newlist=$(echo ${{ steps.flatpak_dependencies.outputs.flatpak_refs }} | \ | |
tr ' ' '\n' | \ | |
grep -v 'org\.freedesktop\.Platform\.openh264' | \ | |
tr '\n' ' ') | |
echo "filtered_flatpak_refs=${newlist}" >> $GITHUB_OUTPUT | |
- name: Build ISOs | |
uses: jasonn3/build-container-installer@main | |
id: build | |
with: | |
arch: x86_64 | |
image_name: ${{ matrix.image_name }} | |
image_repo: ghcr.io/ublue-os | |
variant: 'Silverblue' | |
version: ${{ matrix.major_version }} | |
image_tag: ${{ steps.generate-tag.outputs.tag }} | |
secure_boot_key_url: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' | |
enrollment_password: 'ublue-os' | |
iso_name: ${{ matrix.image_name }}-${{ steps.generate-tag.outputs.tag }}.iso | |
enable_cache_dnf: "false" | |
enable_cache_skopeo: "false" | |
flatpak_remote_refs: ${{ steps.filtered_flatpak_dependencies.outputs.filtered_flatpak_refs }} | |
enable_flatpak_dependencies: "false" | |
- name: Upload ISOs and Checksum to Job Artifacts | |
if: github.ref_name == 'testing' | |
#if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.build.outputs.iso_name }} | |
path: | | |
${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }} | |
${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }}-CHECKSUM | |
if-no-files-found: error | |
retention-days: 0 | |
compression-level: 0 | |
overwrite: true | |
- name: Upload ISOs and Checksum to R2 | |
if: github.event_name == 'workflow_dispatch' && github.ref_name == 'main' | |
shell: bash | |
env: | |
RCLONE_CONFIG_R2_TYPE: s3 | |
RCLONE_CONFIG_R2_PROVIDER: Cloudflare | |
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
RCLONE_CONFIG_R2_REGION: auto | |
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }} | |
SOURCE_ISO_NAME: ${{ steps.build.outputs.iso_name }} | |
SOURCE_ISO_CHECKSUM: ${{ steps.build.outputs.iso_name }}-CHECKSUM | |
SOURCE_ISO_PATH: ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }} | |
SOURCE_ISO_CHECKSUM_PATH: ${{ steps.build.outputs.iso_path }}/${{ steps.build.outputs.iso_name }}-CHECKSUM | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y rclone | |
rclone copyto --s3-no-check-bucket --progress $SOURCE_ISO_PATH R2:bluefin/$SOURCE_ISO_NAME && \ | |
rclone copyto --s3-no-check-bucket --progress $SOURCE_ISO_CHECKSUM_PATH R2:bluefin/$SOURCE_ISO_CHECKSUM |