Skip to content

Commit

Permalink
Retry AUR publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Sep 11, 2024
1 parent f533cd9 commit 324b1e5
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,67 @@ jobs:
tag: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true

aur:
runs-on: ubuntu-22.04
name: Publish to AUR
if: github.ref_type == 'tag'
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Get version
id: version
uses: ./.github/actions/version
-
name: Publish to Arch User Repository (AUR)
shell: bash
run: |
# Set up ssh key and git
mkdir -p ~/.ssh
chmod 0700 ~/.ssh
ssh-keyscan -v -t 'rsa,ecdsa,ed25519' aur.archlinux.org >>~/.ssh/known_hosts
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
git config set --global user.name "${{ secrets.AUR_NAME }}"
git config set --global user.email "${{ secrets.AUR_EMAIL }}"
# Clone to AUR repo
git clone ssh://[email protected]/tomato-radio-automation.git aur
cd aur
# Update versions
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
docker run -i --rm -v "$PWD:/aur" archlinux:base-devel /bin/bash -e <<'EOF'
# Exit on failure
set -e
# Install deps
pacman -Sy --noconfirm --needed pacman-contrib rsync sudo
# Quicker build
sed -i "s/^PKGEXT=.*$/PKGEXT='.pkg.tar'/" /etc/makepkg.conf
# Add user, copy over package build files
useradd builduser -m
echo 'builduser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
cd ~builduser
sudo -u builduser rsync -r --exclude=.git /aur .
# Build package, and confirm it installs properly, clean up
cd aur
sudo -u builduser updpkgsums
sudo -u builduser makepkg -csi --noconfirm
sudo -u builduser makepkg --printsrcinfo > .SRCINFO
rm -v *.tar.gz *.pkg.tar*
# Copy back updated build files
rsync -r ~builduser/aur/ /aur
EOF
# Push changes to AUR
git add .
git commit -m "Moved to version ${{ steps.version.outputs.version }}"
git push

0 comments on commit 324b1e5

Please sign in to comment.