diff --git a/.github/workflows/arch-package.yml b/.github/workflows/arch-package.yml new file mode 100644 index 00000000..54d9102c --- /dev/null +++ b/.github/workflows/arch-package.yml @@ -0,0 +1,41 @@ +name: arch package + +on: + release: + types: [published] + +jobs: + build-arch-pkg: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - name: set git global safe directory + run: | + pacman -Syu git --noconfirm + git config --global --add safe.directory $(realpath .) + - uses: actions/checkout@v3 + - name: Install prerequisites + run: | + echo "ParallelDownloads = 10" >> /etc/pacman.conf + echo "\n" && echo "[multilib]" >> /etc/pacman.conf + echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf + pacman -Syu base-devel sudo meson python-mako glslang hub --noconfirm + - name: makepkg + run: | + echo "nobody ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + chown nobody:nobody pkgbuild + cd pkgbuild + sudo -u nobody -- sh -c "makepkg -fsiCc --noconfirm" + - name: Edit release and add files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -x + assets=() + for pkg in ./pkgbuild/*mangohud*.tar.zst; + do echo $pkg; + assets+=("-a" "$pkg") + done; + tag_name="${GITHUB_REF##*/}" + hub release edit "${assets[@]}" -m "" "$tag_name" \ No newline at end of file