Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
fix: fixed up action and combined build-container and test-iso workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmiller committed Mar 5, 2024
1 parent d90d29f commit dbc6984
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ on:
env:
IMAGE_NAME: "isogenerator"
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
FLATPAK_REFS: app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08

jobs:
push-image:
build-image:
name: Build and push container image
runs-on: ubuntu-22.04
permissions:
Expand All @@ -27,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version:
version:
- 38
- 39
- 40
Expand Down Expand Up @@ -174,15 +175,64 @@ jobs:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}

build-and-push-iso:
name: Build ISO
runs-on: ubuntu-latest
needs: build-image
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
version: [38, 39]
boot: [secureboot, insecure]
include:
- boot: secureboot
SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
ENROLLMENT_PASSWORD: 'ublue-os'
SECURE_BOOT_STRING: '-secure'
- boot: insecure
SECURE_BOOT_KEY_URL: ''
ENROLLMENT_PASSWORD: ''
SECURE_BOOT_STRING: ''

steps:
- name: Build ISO
id: build-iso
uses: ./
with:
ARCH: 'x86_64'
IMAGE_NAME: 'base-main'
IMAGE_REPO: 'ghcr.io/ublue-os'
VARIANT: 'Kinoite'
VERSION: ${{ matrix.version }}
SECURE_BOOT_KEY_URL: ${{ matrix.SECURE_BOOT_KEY_URL }}
ENROLLMENT_PASSWORD: ${{ matrix.ENROLLMENT_PASSWORD }}
FLATPAK_REMOTE_REFS: ${{ env.FLATPAK_REFS }}

- name: Upload ISO as artifact
uses: actions/upload-artifact@v4
with:
name: base-main-${{ matrix.version }}${{ matrix.SECURE_BOOT_STRING }}.iso
path: |
${{ steps.build-iso.outputs.iso-path }}
${{ steps.build-iso.outputs.checksum-path }}
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true

check:
name: Check build successful
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs:
- push-image
- build-and-push-iso
steps:
- name: Exit on failure for main
if: ${{ needs.push-image.result == 'failure' || needs.push-image.result == 'skipped' }}
if: ${{ needs.build-image.result == 'failure' || needs.build-image.result == 'skipped' || needs.build-and-push-iso.result == 'failure' || needs.build-and-push-iso.result == 'skipped' }}
shell: bash
run: exit 1
- name: Exit
Expand Down
89 changes: 0 additions & 89 deletions .github/workflows/test-iso.yml

This file was deleted.

91 changes: 16 additions & 75 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,85 +69,26 @@ outputs:
runs:
using: composite
steps:
- name: Cleanup host
shell: bash
run: |
if [[ -d /host ]]
then
df -h /host
# Remove Android Library
rm -Rf /host/usr/local/lib/android
# Remove .NET runtime
rm -Rf /host/usr/share/dotnet
# Remove Haskell runtime
rm -rf /host/opt/ghc
rm -rf /host/usr/local/.ghcup
chroot /host docker image prune --all --force
df -h /host
else
echo "Host must be mounted as /host in order to make more space"
fi
- name: Install Make
shell: bash
run: dnf install -y make

- name: Install dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: make install-deps

- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ inputs.IMAGE_REPO }}

- name: Download image
shell: bash
working-directory: ${{ github.action_path }}
run: |
make container/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }} \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }}
- name: Create boot.iso
shell: bash
working-directory: ${{ github.action_path }}
run: |
make boot.iso \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }} \
EXTRA_BOOT_PARAMS=${{ inputs.EXTRA_BOOT_PARAMS }} \
SECURE_BOOT_KEY_URL=${{ inputs.SECURE_BOOT_KEY_URL }} \
ENROLLMENT_PASSWORD=${{ inputs.ENROLLMENT_PASSWORD }} \
FLATPAK_REMOTE_NAME=${{ inputs.FLATPAK_REMOTE_NAME }} \
FLATPAK_REMOTE_URL=${{ inputs.FLATPAK_REMOTE_URL }} \
FLATPAK_REMOTE_REFS="${{ inputs.FLATPAK_REMOTE_REFS }}"
- name: Create deploy.iso and generate sha256 checksum
- name: Run docker image and generate sha256 checksum
shell: bash
id: final
working-directory: ${{ github.action_path }}
run: |
make ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }}
# Check if running inside of the action repo
if [[ -z "${{ github.action_ref }}" ]]; then if [[ "${{ github.ref_name }}" =~ (.*)/merge ]]; then tag=pr-${BASH_REMATCH[1]}; else tag=${{ github.ref_name }}; fi; fi
if [[ -z "${tag}" ]]; then tag=${{ github.action_ref }}; fi
docker run --privileged --volume .:/isogenerator/output \
-e ARCH=${{ inputs.arch }} \
-e IMAGE_NAME=${{ inputs.image_name }} \
-e IMAGE_REPO=${{ inputs.image_repo }} \
-e VARIANT=${{ inputs.variant }} \
-e VERSION=${{ inputs.version }} \
-e IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \
-e WEB_UI=${{ inputs.web_ui }} \
-e FLATPAK_REMOTE_NAME=${{ inputs.flatpak_remote_name }} \
-e FLATPAK_REMOTE_URL=${{ inputs.flatpak_remote_url }} \
-e FLATPAK_REMOTE_REFS="${{ inputs.flatpak_remote_refs }}" \
ghcr.io/jasonn3/build-container-installer:${tag}
mkdir end_iso
sha256sum ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso > ./end_iso/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}-CHECKSUM
mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/
Expand Down

0 comments on commit dbc6984

Please sign in to comment.