From 585b141b66c9420951f3ff1c40fe2f244bc834aa Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 25 Oct 2024 12:18:45 -0400 Subject: [PATCH] add setup script testing workflow --- .github/workflows/setup.yml | 33 ++++++++++++++++++++++++++++++++ arch/dwarfs-universal | 38 +++++++++++++++++++++++++++++++++++++ archpkgs => arch/packages | 0 bin/setup | 4 +++- 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/setup.yml create mode 100644 arch/dwarfs-universal rename archpkgs => arch/packages (100%) diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..24e30e5 --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,33 @@ +name: Test dotfiles run + +on: + workflow_dispatch: # allow manual trigger + push: + branches: + - main + + +jobs: + setup: # try setting up user with setup script + runs-on: ubuntu-latest + container: archlinux:latest + + steps: + - name: Install git on container and add user + run: | + pacman -Sy --noconfirm git sudo + pacman-key --init + useradd -m glados + echo 'glados ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/glados + - name: Checkout repo + uses: actions/checkout@v4 + - name: Bump submodules + run: | + cp -r /__w/dotfiles/dotfiles /home/glados/.dotfiles + sudo -u glados /home/glados/.dotfiles/bin/setup + mkdwarfs -i /home/glados -o /home.dwarfs + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: home.dwarfs + path: /home.dwarfs diff --git a/arch/dwarfs-universal b/arch/dwarfs-universal new file mode 100644 index 0000000..e168c59 --- /dev/null +++ b/arch/dwarfs-universal @@ -0,0 +1,38 @@ +# Maintainer: phantop +pkgname=dwarfs-universal +pkgver=0.10.1 +pkgrel=1 +pkgdesc='A fast high compression read-only file system (pre-compiled binaries)' +url='https://github.com/mhx/dwarfs' +source=("https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-${pkgver}-Linux-${CARCH}-clang.tar.xz" + "https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang" + "https://github.com/mhx/dwarfs/raw/main/scripts/extract_blocks.py") +arch=('x86_64' 'aarch64') +license=('GPL3') +depends=( 'fuse3' ) +conflicts=('dwarfs') +provides=('dwarfs') + +package() { + install -Dm755 "${srcdir}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang" "${pkgdir}/usr/bin/dwarfsuniversal" + install -Dm755 "${srcdir}/extract_blocks.py" "${pkgdir}/usr/bin/dwarfsblocks" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsck" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsextract" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/mkdwarfs" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfs" + + # mount will just run dwarfsuniversal otherwise + printf '#!/bin/sh\ndwarfs "$@"' > "${pkgdir}/usr/bin/mount.dwarfs" + chmod 755 "${pkgdir}/usr/bin/mount.dwarfs" + + cd "${srcdir}/dwarfs-${pkgver}-Linux-${CARCH}-clang" + install -Dm644 share/man/man1/dwarfs.1 "$pkgdir/usr/share/man/man1/dwarfs.1" + install -Dm644 share/man/man1/dwarfsck.1 "$pkgdir/usr/share/man/man1/dwarfsck.1" + install -Dm644 share/man/man1/dwarfsextract.1 "$pkgdir/usr/share/man/man1/dwarfsextract.1" + install -Dm644 share/man/man1/mkdwarfs.1 "$pkgdir/usr/share/man/man1/mkdwarfs.1" + install -Dm644 share/man/man5/dwarfs-format.5 "$pkgdir/usr/share/man/man5/dwarfs-format.5" +} +# update by removing and running `makepkg -g >> PKGBUILD` +sha256sums=('SKIP' + 'SKIP' + 'SKIP') diff --git a/archpkgs b/arch/packages similarity index 100% rename from archpkgs rename to arch/packages diff --git a/bin/setup b/bin/setup index cdd333d..aca9b47 100755 --- a/bin/setup +++ b/bin/setup @@ -14,8 +14,10 @@ printf "[dkp-linux]\nServer = https://pkg.devkitpro.org/packages/linux/\$arch/\n echo permit :wheel | t /etc/doas.conf p -Syu -xargs sudo pacman --noconfirm -S --needed < ~/.dotfiles/archpkgs +xargs sudo pacman --noconfirm -S --needed < ~/.dotfiles/arch/packages yay -S pandoc-bin shellcheck-bin --noconfirm +cp ~/.dotfiles/arch/packages/dwarfs-universal /tmp/PKGBUILD +makepkg -sircD /tmp chsh -s "$(grep -m1 bin/fish /etc/shells)" echo kernel.core_pattern=/dev/null | t /etc/sysctl.d/50-coredump.conf