From ad4d9635c654ca0952817b3a393d8bc6bec019eb Mon Sep 17 00:00:00 2001 From: qoijjj <129108030+qoijjj@users.noreply.github.com> Date: Tue, 2 Apr 2024 04:40:57 +0000 Subject: [PATCH] add iso workflow --- .github/workflows/build-38.yml | 15 --- .github/workflows/iso-39.yml | 10 ++ .github/workflows/reusable-iso-release.yml | 110 +++++++++++++++++++++ 3 files changed, 120 insertions(+), 15 deletions(-) delete mode 100644 .github/workflows/build-38.yml create mode 100644 .github/workflows/iso-39.yml create mode 100644 .github/workflows/reusable-iso-release.yml diff --git a/.github/workflows/build-38.yml b/.github/workflows/build-38.yml deleted file mode 100644 index eb71ab98..00000000 --- a/.github/workflows/build-38.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: ublue hwe 38 -on: - pull_request: - merge_group: - schedule: - - cron: '40 15 * * *' # 15:30-ish UTC everyday (30 min delay after 'main' builds) - workflow_dispatch: - -jobs: - build: - name: build - uses: ./.github/workflows/reusable-build.yml - secrets: inherit - with: - fedora_version: 38 \ No newline at end of file diff --git a/.github/workflows/iso-39.yml b/.github/workflows/iso-39.yml new file mode 100644 index 00000000..a68d5b58 --- /dev/null +++ b/.github/workflows/iso-39.yml @@ -0,0 +1,10 @@ +name: ublue uwe iso 39 +on: + workflow_dispatch: +jobs: + build: + name: build + uses: ./.github/workflows/reusable-iso-release.yml + secrets: inherit + with: + fedora_version: 39 \ No newline at end of file diff --git a/.github/workflows/reusable-iso-release.yml b/.github/workflows/reusable-iso-release.yml new file mode 100644 index 00000000..6c6ed200 --- /dev/null +++ b/.github/workflows/reusable-iso-release.yml @@ -0,0 +1,110 @@ +name: ublue iso release +on: + workflow_call: + inputs: + fedora_version: + description: 'The Fedora release version: 38, 39, 40, etc' + required: true + type: string +env: + IMAGE_REGISTRY: ghcr.io/ublue-os +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.fedora_version }} + cancel-in-progress: true +jobs: + build_ublue: + name: hwe + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + id-token: write + strategy: + fail-fast: false + matrix: + fedora_version: + - ${{ inputs.fedora_version }} + hwe_flavor: + - main + - asus + - surface + image_name: + - silverblue + - kinoite + - sericea + - onyx + - base + - lazurite + - mate + - vauxite + nvidia_version: + - 0 # No Nvidia drivers (this indicates to only build "main" image target + - 470 # Older Nvidia driver + - 550 # Latest Nvidia driver (update IS_LATEST_DRIVER below if version changes) + exclude: + # There is currently no Fedora 40 version of mate + - image_name: mate + fedora_version: 40 + # Don't build/push "main" since it would be a duplicate of the "base" `*-main` images + - nvidia_version: 0 + hwe_flavor: main + # Only build latest nvidia version for "surface" HWE flavor + - nvidia_version: 470 + hwe_flavor: surface + # Only build latest nvidia version for F40 (temporarily broken? not building in akmods) + - fedora_version: 40 + nvidia_version: 470 + steps: + # Checkout push-to-registry action GitHub repository + - name: Checkout Push to Registry action + uses: actions/checkout@v4 + + - name: Matrix Variables + shell: bash + run: | + if [[ "${{ matrix.hwe_flavor }}" == "main" ]]; then + if [[ "${{ matrix.nvidia_version }}" == "0" ]]; then + echo "this workflow does not build main image without Nvidia drivers" + exit 1 + fi + echo "IMAGE_NAME=${{ matrix.image_name }}-nvidia" >> $GITHUB_ENV + else + if [[ "${{ matrix.nvidia_version }}" == "0" ]]; then + echo "IMAGE_NAME=${{ matrix.image_name }}-${{ matrix.hwe_flavor }}" >> $GITHUB_ENV + else + echo "IMAGE_NAME=${{ matrix.image_name }}-${{ matrix.hwe_flavor }}-nvidia" >> $GITHUB_ENV + fi + fi + echo "SOURCE_IMAGE=${{ matrix.image_name }}-main" >> $GITHUB_ENV + + if [[ "${{ matrix.image_name }}" == "silverblue" ]]; then + export IMAGE_VARIANT=Silverblue + else + export IMAGE_VARIANT=Kinoite + fi + echo "IMAGE_VARIANT=${IMAGE_VARIANT}" >> $GITHUB_ENV + + TIMESTAMP="$(date +%Y%m%d)" + echo "TIMESTAMP=${TIMESTAMP}" >> $GITHUB_ENV + + + - name: Build ISOs + uses: ublue-os/isogenerator@1.0.9 + id: build + with: + ARCH: x86_64 + IMAGE_NAME: ${{ env.IMAGE_NAME }} + IMAGE_REPO: ${{ env.IMAGE_REGISTRY }} + VARIANT: ${{ env.IMAGE_VARIANT }} + VERSION: ${{ matrix.fedora_version }} + IMAGE_TAG: ${{ matrix.fedora_version }} + SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' + ENROLLMENT_PASSWORD: 'ublue-os' + + - name: Upload ISO to archive.org + uses: qoijjj/internet-archive-upload@v7 + with: + access-key: ${{ secrets.IA_ACCESS_KEY }} + secret-key: ${{ secrets.IA_SECRET_KEY }} + identifier: ${{ env.IMAGE_NAME }}-${{ env.TIMESTAMP }} + files: ${{ steps.build.outputs.output-directory }} \ No newline at end of file