diff --git a/.github/workflows/validate-brewfiles.yml b/.github/workflows/validate-brewfiles.yml index c852e6c..78f78ee 100644 --- a/.github/workflows/validate-brewfiles.yml +++ b/.github/workflows/validate-brewfiles.yml @@ -5,7 +5,7 @@ permissions: on: pull_request: paths: - - "brew/**" + - "system_files/shared/usr/share/ublue-os/homebrew/**" jobs: validate: runs-on: ubuntu-latest @@ -16,25 +16,51 @@ jobs: - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@main - - name: Validate Brewfiles shell: bash run: | - echo "Validating Brewfiles..." - - - find "system_files/shared/usr/share/ublue-os/homebrew" -iname '*\.Brewfile*' -print0 | \ - while IFS= read -r -d '' brewfile ; do \ - echo "::group:: ===$(basename $brewfile)===" - grep -E -e "^tap" $brewfile > taps.Brewfile - set -xeuo pipefail - brew bundle --file=./taps.Brewfile - if brew bundle exec whoami --file="$brewfile" | grep -F -e "${USER}" ; then - echo "✓ $brewfile is valid" - else - echo "✗ $brewfile validation failed" - exit 1 - fi - set +xeuo pipefail - echo "::endgroup::" - done + echo "Validating Brewfiles in homebrew directory..." + + STATUS_FILE=$(mktemp) + echo "PASS" > "$STATUS_FILE" + + while IFS= read -r -d '' brewfile ; do + echo "::group:: ===$(basename $brewfile)===" + + grep -E -e "^tap" "$brewfile" > taps.Brewfile || true + echo "Syncing taps..." + brew bundle --file=./taps.Brewfile > /dev/null 2>&1 || true + + # Extract combined list for parallel check + FORMULAS=$(grep -E '^\s*brew\s+["'\'']' "$brewfile" | sed -E 's/^\s*brew\s+["'\'']([^"'\'']+)["'\''].*/formula \1/' || true) + CASKS=$(grep -E '^\s*cask\s+["'\'']' "$brewfile" | sed -E 's/^\s*cask\s+["'\'']([^"'\'']+)["'\''].*/cask \1/' || true) + + ENTRIES=$(printf "%s\n%s" "$FORMULAS" "$CASKS" | grep -v '^\s*$' || true) + + if [ -n "$ENTRIES" ]; then + echo "$ENTRIES" | xargs -P 8 -I {} bash -c ' + TYPE=$(echo "{}" | cut -d" " -f1) + NAME=$(echo "{}" | cut -d" " -f2) + if ! brew info --$TYPE "$NAME" &> /dev/null; then + echo "✗ $TYPE \"$NAME\" is invalid or missing tap" + echo "FAIL" >> "'"$STATUS_FILE"'" + else + echo "✓ $TYPE \"$NAME\" is valid" + fi + ' + else + echo "No formulas or casks found." + fi + + echo "::endgroup::" + done < <(find "system_files/shared/usr/share/ublue-os/homebrew" -iname '*\.Brewfile*' -print0) + + rm -f taps.Brewfile + + if grep -q "FAIL" "$STATUS_FILE"; then + echo "Validation complete. Some Brewfiles FAILED." + exit 1 + else + echo "Validation complete. All Brewfiles PASSED." + exit 0 + fi diff --git a/.github/workflows/validate-flatpaks.yml b/.github/workflows/validate-flatpaks.yml deleted file mode 100644 index a32c106..0000000 --- a/.github/workflows/validate-flatpaks.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Validate Flatpaks -permissions: - contents: read - -on: - pull_request: - paths: - - "flatpaks/**" -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 - - - name: Get Flathub apps - shell: bash - run: | - FLATHUB_LIST=$(mktemp) - curl -X 'GET' \ - 'https://flathub.org/api/v2/appstream?filter=apps' \ - -H 'accept: application/json' | jq -r ".[]" >> "${FLATHUB_LIST}" - - curl -X 'GET' \ - 'https://flathub.org/api/v2/appstream?filter=runtime' \ - -H 'accept: application/json' | jq -r ".[]" >> "${FLATHUB_LIST}" - - set -xeuo pipefail - - find "flatpaks" -iname '*.list*' -print0 | \ - while IFS= read -r -d '' flatpaks_file; do - echo "::group:: ===$(basename "$flatpaks_file")===" - grep -vE '^#' "$flatpaks_file" | while read -r flatpak; do - # Only output on errors - if ! grep -Fxq "$flatpak" "$FLATHUB_LIST"; then - echo "$flatpak NOT found on Flathub" - exit 1 - fi - done - - echo "::endgroup::" - done - diff --git a/Containerfile b/Containerfile index 5ac448d..ee7f11c 100644 --- a/Containerfile +++ b/Containerfile @@ -70,5 +70,4 @@ FROM scratch AS ctx COPY --from=ghcr.io/projectbluefin/common:latest /system_files/shared /system_files/shared COPY --from=builder /out/wallpapers /wallpapers COPY --from=builder /out/logos /logos -COPY /flatpaks /flatpaks COPY /system_files /system_files diff --git a/system_files/shared/usr/share/ublue-os/homebrew/system-dx-flatpaks.Brewfile b/system_files/shared/usr/share/ublue-os/homebrew/system-dx-flatpaks.Brewfile new file mode 100644 index 0000000..e1e3ffb --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/homebrew/system-dx-flatpaks.Brewfile @@ -0,0 +1,4 @@ +# Flatpaks for DX mode on Aurora +flatpak "io.podman_desktop.PodmanDesktop" +flatpak "io.github.getnf.embellish" +flatpak "me.iepure.devtoolbox" diff --git a/system_files/shared/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile b/system_files/shared/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile new file mode 100644 index 0000000..79b70a6 --- /dev/null +++ b/system_files/shared/usr/share/ublue-os/homebrew/system-flatpaks.Brewfile @@ -0,0 +1,21 @@ +# Default system-wide flatpaks for Aurora +flatpak "com.github.tchx84.Flatseal" +flatpak "com.ranfdev.DistroShelf" +flatpak "io.github.flattool.Warehouse" +flatpak "io.github.kolunmi.Bazaar" +flatpak "io.missioncenter.MissionCenter" +flatpak "org.deskflow.deskflow" +flatpak "org.fedoraproject.MediaWriter" +flatpak "org.fkoehler.KTailctl" +flatpak "org.gnome.DejaDup" +flatpak "org.gtk.Gtk3theme.Breeze" +flatpak "org.kde.gwenview" +flatpak "org.kde.haruna" +flatpak "org.kde.kcalc" +flatpak "org.kde.kclock" +flatpak "org.kde.kontact" +flatpak "org.kde.kweather" +flatpak "org.kde.okular" +flatpak "org.kde.skanpage" +flatpak "org.mozilla.Thunderbird" +flatpak "org.mozilla.firefox"