Repository navigation
feat: implement existing partition install mode in TUI, GUI, and backend #56
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: Public Repo | |
| on: | |
| push: | |
| paths: | |
| - "pkgbuilds/**" | |
| - "mochi/**" | |
| - "mochiinstall_wrapper" | |
| - "installer.py" | |
| - "mochiinstall_app.py" | |
| - "mochi_ascii.py" | |
| - "build.sh" | |
| - "scripts/**" | |
| - ".github/workflows/repo.yml" | |
| - ".github/workflows/build-iso.yml" | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| run: | | |
| pacman-key --init | |
| pacman-key --populate archlinux | |
| pacman -Sy --noconfirm base-devel go python python-textual zstd git fakeroot nasm autoconf automake mtools clang lld llvm gnu-efi | |
| - name: Create builder | |
| run: | | |
| useradd -m builder | |
| echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| - name: GPG key | |
| run: | | |
| mkdir -p /home/builder/.gnupg | |
| chmod 700 /home/builder/.gnupg | |
| printf 'Key-Type: RSA\nKey-Length: 4096\nSubkey-Type: RSA\nSubkey-Length: 4096\nName-Real: MochiOS\nName-Email: ci@mochios.dev\nExpire-Date: 0\n%%no-protection\n%%commit\n' | gpg --homedir /home/builder/.gnupg --batch --gen-key | |
| mkdir -p /repo/pubkey | |
| gpg --homedir /home/builder/.gnupg --export --armor ci@mochios.dev > /repo/pubkey/mochios-key.pub | |
| - name: Build mochi | |
| run: | | |
| chown -R builder:builder "$PWD" | |
| cd pkgbuilds/mochi | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochi-$pkgver.tar.gz" -C "$PWD/../../mochi" . | |
| export GOTOOLCHAIN=local | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochiinstall | |
| run: | | |
| cd pkgbuilds/mochiinstall | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochiinstall-$pkgver.tar.gz" \ | |
| -C "$PWD/../.." \ | |
| mochiinstall_wrapper installer.py mochiinstall_app.py mochiinstall_gui.py mochi_ascii.py | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochiboot | |
| run: | | |
| cd pkgbuilds/mochiboot | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochiboot-$pkgver.tar.gz" --exclude="mochiboot-$pkgver.tar.gz" --exclude='pkg' --exclude='src' * | |
| CC_FOR_TARGET=gcc LD_FOR_TARGET=ld.lld OBJCOPY_FOR_TARGET=llvm-objcopy sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochi-abroot | |
| run: | | |
| cd pkgbuilds/mochi-abroot | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochi-abroot-$pkgver.tar.gz" -C "$PWD" abroot.sh abroot.conf | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochi-splash | |
| continue-on-error: true | |
| run: | | |
| cd pkgbuilds/mochi-splash | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochi-splash-$pkgver.tar.gz" -C "$PWD" splash.c Makefile | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochios-branding | |
| run: | | |
| cd pkgbuilds/mochios-branding | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochios-branding-$pkgver.tar.gz" -C "$PWD" usr | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochios-branding-nightly | |
| run: | | |
| cd pkgbuilds/mochios-branding-nightly | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochios-branding-nightly-$pkgver.tar.gz" -C "$PWD" etc usr | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build mochios-defaults | |
| run: | | |
| cd pkgbuilds/mochios-defaults | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "mochios-defaults-$pkgver.tar.gz" -C "$PWD" etc usr mochios-release | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build sober | |
| run: | | |
| cd pkgbuilds/sober | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| tar czf "sober-$pkgver.tar.gz" -C "$PWD" sober-wrapper.sh | |
| sudo -u builder makepkg -cf --noconfirm --nodeps | |
| - name: Build zen-browser | |
| run: | | |
| cd pkgbuilds/zen-browser | |
| pkgver=$(grep -oP '^pkgver=\K.*' PKGBUILD | head -1) | |
| sudo -u builder makepkg -cf --noconfirm --nodeps --skipchecksums | |
| - name: Create repo | |
| run: | | |
| mkdir -p /repo/os/x86_64 | |
| for dir in pkgbuilds/*/; do | |
| for f in "$dir"*.pkg.tar.zst; do | |
| [ -f "$f" ] || continue | |
| cp "$f" /repo/os/x86_64/ | |
| done | |
| done | |
| cp /repo/pubkey/mochios-key.pub /repo/os/x86_64/ | |
| - name: Sign packages + repo-add | |
| run: | | |
| cd /repo/os/x86_64 | |
| for pkg in *.pkg.tar.zst; do | |
| gpg --homedir /home/builder/.gnupg \ | |
| --batch --no-tty --pinentry-mode=loopback --passphrase "" \ | |
| --detach-sign "$pkg" 2>/dev/null || true | |
| done | |
| repo-add --sign mochi.db.tar.zst *.pkg.tar.zst | |
| - name: Replace symlinks with real files | |
| run: | | |
| echo "checking /repo/os/x86_64..." | |
| ls -la /repo/os/x86_64/ || echo "dir not found!" | |
| cd /repo/os/x86_64 | |
| for f in mochi.db mochi.files; do | |
| if [ -L "$f" ]; then | |
| real="${f}.tar.zst" | |
| rm -f "$f" "${f}.sig" | |
| zstd -dq "$real" -o "$f" || cp -v "$real" "$f" | |
| echo " $f: $(file "$f" | cut -d: -f2)" | |
| fi | |
| if [ -f "${f}.tar.zst.sig" ]; then | |
| cp -v "${f}.tar.zst.sig" "${f}.sig" || true | |
| fi | |
| done | |
| echo "done" | |
| - name: Static binary | |
| run: | | |
| mkdir -p /repo/static /tmp/mochi-extract | |
| cd /repo/os/x86_64 | |
| pkgfile="$(ls mochi-*.pkg.tar.zst | grep -v debug | head -1)" | |
| tar -I zstd -xf "$pkgfile" -C /tmp/mochi-extract | |
| cp /tmp/mochi-extract/usr/bin/mochi /repo/static/mochi | |
| chmod +x /repo/static/mochi | |
| - name: Install script | |
| run: | | |
| cp "$PWD/scripts/install.sh" /repo/install.sh | |
| chmod +x /repo/install.sh | |
| - name: Deploy to gh-pages | |
| run: | | |
| cd /repo | |
| find os -name 'zen-browser-*' -delete | |
| git init | |
| git config user.name "bot" | |
| git config user.email "bot@mochios.dev" | |
| git checkout -b gh-pages | |
| git add -A | |
| git commit -m "repo: update packages [ci skip]" | |
| git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
| git push -f origin gh-pages |