Improve upstream package override installation and add python3-apt …
#92
This file contains hidden or 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 Utile OS 26 AMD64 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths-ignore: | |
| - '*.md' | |
| - '.gitignore' | |
| - 'resources/**' | |
| - '.vscode/**' | |
| workflow_dispatch: | |
| jobs: | |
| gen-custom-iso: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| TZ: 'Africa/Cairo' | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6.4.0 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Preseed snaps and inject disk release | |
| env: | |
| # If this was triggered by a tag (release), set to release. Otherwise, nightly will automatically be used. | |
| BUILD_TYPE: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || '' }} | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| run: | | |
| set -exuo pipefail # Strict | |
| pnpm install | |
| sudo snap install snapcraft --classic | |
| snapcraft whoami | |
| mkdir -p ~/.snap/gnupg && chmod 0700 ~/.snap/gnupg | |
| gpg --homedir ~/.snap/gnupg --list-keys | |
| echo '${{ secrets.SNAPCRAFT_UTILE_MODEL_ACTIONS_KEY }}' | gpg --homedir ~/.snap/gnupg --import | |
| snapcraft keys | |
| node src/preseed-snaps.js | |
| snap debug validate-seed tooling/seed/ | |
| # Run the compilation script | |
| SH_NAME=$(node . | tail -n 1) | |
| TEMP_NAME=${SH_NAME#utile-os-} | |
| TAG_NAME=${TEMP_NAME%.sh} | |
| ISO_NAME="${SH_NAME%.sh}" | |
| echo "SH_NAME=$SH_NAME" >> $GITHUB_ENV | |
| echo "ISO_NAME=$ISO_NAME" >> $GITHUB_ENV | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
| # Verify the output exists | |
| ls -la "dist/$SH_NAME" | |
| node src/inject-disk-release.js | |
| - name: Inject GRUB config | |
| run: | | |
| sudo mkdir -p tooling/iso_overlay/boot/grub | |
| sudo tee tooling/iso_overlay/boot/grub/grub.cfg << 'EOF' | |
| set timeout=30 | |
| loadfont unicode | |
| set menu_color_normal=white/black | |
| set menu_color_highlight=black/light-gray | |
| menuentry "Try or Install Utile OS" { | |
| set gfxpayload=keep | |
| linux /casper/vmlinuz --- quiet splash | |
| initrd /casper/initrd | |
| } | |
| menuentry "Utile OS (safe graphics)" { | |
| set gfxpayload=keep | |
| linux /casper/vmlinuz nomodeset --- quiet splash | |
| initrd /casper/initrd | |
| } | |
| grub_platform | |
| if [ "$grub_platform" = "efi" ]; then | |
| menuentry 'Boot from next volume' { | |
| exit 1 | |
| } | |
| menuentry 'UEFI Firmware Settings' { | |
| fwsetup | |
| } | |
| fi | |
| EOF | |
| - name: Build | |
| run: | | |
| docker run --privileged \ | |
| --security-opt apparmor=unconfined \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -v /sys/kernel/security:/sys/kernel/security \ | |
| -e ISO_NAME="${{ env.ISO_NAME }}" \ | |
| -e SH_NAME="${{ env.SH_NAME }}" \ | |
| -e TZ="${{ env.TZ }}" \ | |
| --platform linux/amd64 \ | |
| --name utile-build-container \ | |
| -w /workspace \ | |
| ubuntu:26.04 /bin/bash /workspace/tooling/isobuild.sh | |
| - name: Create new GitHub Release | |
| uses: softprops/action-gh-release@v3.0.0 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| name: Utile OS ${{ env.TAG_NAME }} | |
| files: | | |
| dist/${{ env.SH_NAME }} | |
| tooling/isobuild.sh | |
| # Automatically mark as pre-release if it's a nightly or beta | |
| prerelease: ${{ contains(env.TAG_NAME, 'nightly') || contains(env.TAG_NAME, 'beta') }} | |
| - name: Upload ISO to Gofile.io | |
| env: | |
| GOFILE_KEY: ${{ secrets.GOFILE_KEY }} | |
| run: | | |
| RESPONSE=$(curl --progress-bar --retry 3 -X POST -F "file=@${{ env.ISO_NAME }}-amd64.iso" -F "folderId=fcaef33b-8e99-4a74-b4cc-8949bdbfb6c6" -H "Authorization: Bearer ${{ env.GOFILE_KEY }}" -H "Accept: application/json" "https://upload-eu-par.gofile.io/contents/uploadfile") | |
| CONTENT_ID=$(echo "$RESPONSE" | jq -r '.data.id') | |
| echo "Uploaded ISO to Gofile with ID: $CONTENT_ID" | |
| # calculate sha256 checksum | |
| sha256sum ${{ env.ISO_NAME }}-amd64.iso > ${{ env.ISO_NAME }}-amd64.iso.sha256sum | |
| echo "sha256sum: $(cat ${{ env.ISO_NAME }}-amd64.iso.sha256sum)" | |
| # Upload checksum to Gofile | |
| curl --progress-bar --retry 3 -X POST -F "file=@${{ env.ISO_NAME }}-amd64.iso.sha256sum" -F "folderId=fcaef33b-8e99-4a74-b4cc-8949bdbfb6c6" -H "Authorization: Bearer ${{ env.GOFILE_KEY }}" "https://upload-eu-par.gofile.io/contents/uploadfile" | |
| # Sign sum (users can download key to verify via `gpg --keyserver keyserver.ubuntu.com --recv-keys 6FDCDB25DD68F9C257DD6B6AAD2B8A9E1D1C31B2`) | |
| echo '${{ secrets.ISO_SIGNING_KEY }}' | gpg --import | |
| gpg -u AD2B8A9E1D1C31B2 --detach-sign --armor ${{ env.ISO_NAME }}-amd64.iso.sha256sum | |
| mv ${{ env.ISO_NAME }}-amd64.iso.sha256sum.asc ${{ env.ISO_NAME }}-amd64.iso.sha256sum.gpg | |
| # Upload signature to Gofile | |
| curl --progress-bar --retry 3 -X POST -F "file=@${{ env.ISO_NAME }}-amd64.iso.sha256sum.gpg" -F "folderId=fcaef33b-8e99-4a74-b4cc-8949bdbfb6c6" -H "Authorization: Bearer ${{ env.GOFILE_KEY }}" "https://upload-eu-par.gofile.io/contents/uploadfile" |