Repository navigation
fix: rename Object.String field to Value to resolve Go field/method c… #46
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 MochiOS ISO | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| options: --privileged | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Arch Linux | |
| run: | | |
| pacman-key --init | |
| pacman-key --populate archlinux | |
| echo "Server = https://mirror.rackspace.com/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist | |
| pacman -Sy --noconfirm | |
| - name: Install build dependencies | |
| run: | | |
| pacman -S --needed --noconfirm \ | |
| archiso \ | |
| base-devel \ | |
| sudo \ | |
| go \ | |
| python \ | |
| python-urwid \ | |
| squashfs-tools \ | |
| dosfstools \ | |
| mtools \ | |
| openssl \ | |
| zstd \ | |
| fakeroot \ | |
| debugedit | |
| - name: Create mochi user with passwordless sudo | |
| run: | | |
| useradd -m mochi | |
| echo "mochi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| chown -R mochi:mochi /home/mochi | |
| - name: Create GPG signing key | |
| run: | | |
| mkdir -p /home/mochi/.mochios-gnupg | |
| chmod 700 /home/mochi/.mochios-gnupg | |
| printf 'Key-Type: RSA\nKey-Length: 4096\nSubkey-Type: RSA\nSubkey-Length: 4096\nName-Real: MochiOS CI Signing Key\nName-Email: ci@mochios.dev\nExpire-Date: 0\n%%no-protection\n%%commit\n' | gpg --homedir /home/mochi/.mochios-gnupg --batch --gen-key | |
| mkdir -p repo/pubkey | |
| gpg --homedir /home/mochi/.mochios-gnupg --export --armor ci@mochios.dev > repo/pubkey/mochios-key.pub | |
| - name: Build packages | |
| run: | | |
| chown -R mochi:mochi "$PWD" | |
| chmod +x build.sh | |
| # Override paths for CI (we're at /__w/mochios/mochios or similar) | |
| export MOCHIOS_DIR="$PWD" | |
| export REPO_DIR="$PWD/repo" | |
| export OUT_DIR="$PWD/out" | |
| export ISO_DIR="$PWD/archiso-mochios" | |
| export WORK_DIR="$PWD/work" | |
| export GNUPGHOME="/home/mochi/.mochios-gnupg" | |
| export SIGN_KEY="ci@mochios.dev" | |
| export GOTOOLCHAIN="local" | |
| bash build.sh 2>&1 | tee build.log; exit ${PIPESTATUS[0]} | |
| - name: Upload build log | |
| if: always() | |
| run: | | |
| if [ -f build.log ] && [ -s build.log ]; then | |
| echo "=== Full build log ===" | |
| cat build.log | |
| else | |
| echo "No build log found or empty" | |
| fi | |
| - name: Upload build log as artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log | |
| path: build.log | |
| retention-days: 7 | |
| - name: Annotate full build log | |
| if: failure() | |
| run: | | |
| if [ -f build.log ] && [ -s build.log ]; then | |
| # annotate the full log as a single multiline annotation | |
| # escape % and newlines for github workflow commands | |
| log="$(cat build.log | head -c 3000)" | |
| log="${log//'%'/'%25'}" | |
| log="${log//$'\n'/'%0A'}" | |
| log="${log//$'\r'/'%0D'}" | |
| echo "::error file=build.sh,title=Build Log::${log}" | |
| fi | |
| - name: List ISO output | |
| run: | | |
| ls -lh out/*.iso 2>/dev/null || echo "No ISO found" | |
| ls -lh repo/os/x86_64/ 2>/dev/null || echo "No packages found" | |
| - name: Upload ISO artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mochios-iso | |
| path: out/*.iso | |
| retention-days: 30 | |
| - name: Upload packages artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mochios-packages | |
| path: repo/os/x86_64/*.pkg.tar.zst | |
| retention-days: 30 |