diff --git a/.github/workflows/aur-checker.yml b/.github/workflows/aur-checker.yml new file mode 100644 index 0000000..d0cc010 --- /dev/null +++ b/.github/workflows/aur-checker.yml @@ -0,0 +1,16 @@ +name: AUR install + +on: + schedule: + - cron: "32 5 */3 * *" + push: + branches: [ master, main ] + +jobs: + test-install: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install AUR package + run: ./scripts/check-aur.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 585f96a..d20f73d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ SteamAuth/SteamAuth/packages/ test_maFiles/ *.deb +*.tar.gz target/ aur/ diff --git a/scripts/check-aur.sh b/scripts/check-aur.sh new file mode 100755 index 0000000..c0c0d6a --- /dev/null +++ b/scripts/check-aur.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Performs a test install of the package from the AUR. If the package fails to install, there should be a non-zero exit code. +# Intended for use with CI. + +set -e + +cd scripts/docker/arch/ +tar -cvf arch-docker.tar.gz . +docker image build -t steamguard-cli-archlinux-builder - < arch-docker.tar.gz +rm arch-docker.tar.gz + +docker run -it --rm steamguard-cli-archlinux-builder /bin/bash -c "./install.sh steamguard-cli-git && steamguard-cli --version" + +docker image rm steamguard-cli-archlinux-builder:latest diff --git a/scripts/docker/arch/Dockerfile b/scripts/docker/arch/Dockerfile new file mode 100644 index 0000000..2813c1e --- /dev/null +++ b/scripts/docker/arch/Dockerfile @@ -0,0 +1,3 @@ +FROM greyltc/archlinux-aur:yay + +COPY install.sh /install.sh diff --git a/scripts/docker/arch/install.sh b/scripts/docker/arch/install.sh new file mode 100755 index 0000000..f5585dd --- /dev/null +++ b/scripts/docker/arch/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PACKAGE="$1" +echo "Installing $PACKAGE" +sudo -u ab -D~ bash -c "yay -Syu --removemake --needed --noprogressbar --noconfirm $PACKAGE"