diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7d67cdd..5884ad6 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -20,7 +20,7 @@ env: IMAGE_REPO: 'quay.io/fedora-ostree-desktops' IMAGE_TAG: '39' VARIANT: 'Server' - FLATPAK_REMOTE_REFS_DIR: flatpak_refs + FLATPAK_REMOTE_REFS_DIR: /github/workspace/flatpak_refs SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' @@ -103,7 +103,7 @@ jobs: type=ref,event=branch type=ref,event=pr - - name: Build ISO with new container + - name: Build ISO uses: ./ id: build with: @@ -113,7 +113,7 @@ jobs: image_tag: ${{ env.IMAGE_TAG }} version: ${{ matrix.version }} variant: ${{ env.VARIANT }} - flatpak_remote_refs: ${{ env.FLATPAK_REMOTE_REFS }} + flatpak_remote_refs_dir: ${{ env.FLATPAK_REMOTE_REFS_DIR }} secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }} enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso diff --git a/Makefile b/Makefile index e72c0bd..1d6a94e 100644 --- a/Makefile +++ b/Makefile @@ -124,14 +124,15 @@ endif # Step 7: Build end ISO ## Default action -build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt +build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt mkdir $(_BASE_DIR)/build || true xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso -lorax_repo: +external/lorax/branch-$(VERSION): git config advice.detachedHead false - cd external/lorax && git checkout tags/$(shell cd external/lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | tail -n 1) + cd external/lorax && git reset --hard HEAD && git checkout tags/$(shell cd external/lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | tail -n 1) + touch external/lorax/branch-$(VERSION) # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% @@ -150,13 +151,8 @@ repos/%.repo: /etc/yum.repos.d/%.repo sed -i "s/\$$releasever/${VERSION}/g" $(_BASE_DIR)/repos/$*.repo sed -i "s/\$$basearch/${ARCH}/g" $(_BASE_DIR)/repos/$*.repo -# Don't do anything for custom repos -%.repo: - -flatpak_list: - # Step 3: Build boot.iso using Lorax -boot.iso: lorax_repo $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES) +boot.iso: external/lorax/branch-$(VERSION) $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES) rm -Rf $(_BASE_DIR)/results || true mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf || true @@ -254,4 +250,4 @@ test-vm: chmod +x $(foreach test,$(_TESTS),tests/vm/$(test)) for test in $(_TESTS); do ./tests/vm/$${test} deploy.iso; done -.PHONY: clean install-deps test test-iso test-vm lorax_repo flatpak_list +.PHONY: clean install-deps test test-iso test-vm diff --git a/action.yml b/action.yml index f2eb50f..84f9337 100644 --- a/action.yml +++ b/action.yml @@ -154,14 +154,26 @@ runs: then cache="${cache} -v /cache/dnf_new:/cache/dnf_new" fi + vars="" + if [[ -n "${{ inputs.flatpak_remote_refs }}" ]] && [[ -n "${{ inputs.flatpak_remote_refs_dir }}" ]] + then + echo "ERROR: flatpak_remote_refs is mutually exclusive to flatpak_remote_refs_dir" + exit 1 + else + if [[ -n "${{ inputs.flatpak_remote_refs }}" ]] + then + vars="${vars} FLATPAK_REMOTE_REFS=\"${{ inputs.flatpak_remote_refs }}\"" + else + vars="${vars} FLATPAK_REMOTE_REFS_DIR=\"${{ inputs.flatpak_remote_refs_dir }}\"" + fi + fi docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ghcr.io/jasonn3/build-container-installer:${tag} \ ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \ ARCH="${{ inputs.arch }}" \ DNF_CACHE="/cache/dnf" \ ENROLLMENT_PASSWORD="${{ inputs.enrollment_password }}" \ FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \ - FLATPAK_REMOTE_REFS="${{ inputs.flatpak_remote_refs }}" \ - FLATPAK_REMOTE_REFS_DIR="${{ inputs.flatpak_remote_refs_dir }}" \ + ${vars} \ FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \ IMAGE_NAME="${{ inputs.image_name }}" \ IMAGE_REPO="${{ inputs.image_repo }}" \ diff --git a/flatpak_refs/Firefox b/flatpak_refs/Firefox new file mode 100644 index 0000000..fdc2b93 --- /dev/null +++ b/flatpak_refs/Firefox @@ -0,0 +1,5 @@ +app/org.mozilla.firefox/x86_64/stable + +runtime/org.mozilla.firefox.Locale/x86_64/stable +runtime/org.freedesktop.Platform/x86_64/23.08 +runtime/org.freedesktop.Platform.Locale/x86_64/23.08 \ No newline at end of file diff --git a/lorax_templates/flatpak_set_repo.tmpl b/lorax_templates/flatpak_set_repo.tmpl index 8feda96..30992db 100644 --- a/lorax_templates/flatpak_set_repo.tmpl +++ b/lorax_templates/flatpak_set_repo.tmpl @@ -6,6 +6,6 @@ replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_rem replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py % endif -%if flatpak_remote_name != 'fedora' +%if flatpak_remote_name != 'fedora': systemctl disable flatpak-add-fedora-repos.service -% endif \ No newline at end of file +% endif