This commit is contained in:
82
.gitea/workflows/aur-publish.yml
Normal file
82
.gitea/workflows/aur-publish.yml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
name: Publish to AUR
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
aur:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: archlinux:base-devel
|
||||||
|
steps:
|
||||||
|
- name: Install base tools
|
||||||
|
run: pacman -Syu --noconfirm git openssh pacman-contrib nodejs sudo
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Extract version from tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF#refs/tags/v}"
|
||||||
|
echo "version=$TAG" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Publishing pi3-smart-workspace v$TAG to AUR"
|
||||||
|
|
||||||
|
- name: Configure SSH for AUR
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
|
||||||
|
chmod 600 ~/.ssh/aur
|
||||||
|
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
|
cat > ~/.ssh/config <<'EOF'
|
||||||
|
Host aur.archlinux.org
|
||||||
|
User aur
|
||||||
|
IdentityFile ~/.ssh/aur
|
||||||
|
StrictHostKeyChecking accept-new
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Create unprivileged build user
|
||||||
|
run: |
|
||||||
|
useradd -m builder
|
||||||
|
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
|
mkdir -p /home/builder/.ssh
|
||||||
|
cp -r ~/.ssh/. /home/builder/.ssh/
|
||||||
|
chown -R builder:builder /home/builder/.ssh
|
||||||
|
chmod 600 /home/builder/.ssh/aur
|
||||||
|
|
||||||
|
- name: Clone existing AUR repo (or init new)
|
||||||
|
run: |
|
||||||
|
git clone ssh://aur@aur.archlinux.org/pi3-smart-workspace.git aur-pkg 2>&1 || true
|
||||||
|
if [ ! -d aur-pkg/.git ]; then
|
||||||
|
mkdir -p aur-pkg
|
||||||
|
cd aur-pkg
|
||||||
|
git init -b master
|
||||||
|
git remote add origin ssh://aur@aur.archlinux.org/pi3-smart-workspace.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Render PKGBUILD for this release
|
||||||
|
run: |
|
||||||
|
cp packaging/aur/PKGBUILD aur-pkg/PKGBUILD
|
||||||
|
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" aur-pkg/PKGBUILD
|
||||||
|
sed -i "s/^pkgrel=.*/pkgrel=1/" aur-pkg/PKGBUILD
|
||||||
|
|
||||||
|
- name: Update checksums and regenerate .SRCINFO
|
||||||
|
run: |
|
||||||
|
chown -R builder:builder aur-pkg
|
||||||
|
cd aur-pkg
|
||||||
|
sudo -u builder updpkgsums
|
||||||
|
sudo -u builder makepkg --printsrcinfo > .SRCINFO
|
||||||
|
|
||||||
|
- name: Commit and push to AUR
|
||||||
|
run: |
|
||||||
|
cd aur-pkg
|
||||||
|
git config user.name "Asger Geel Weirsoe"
|
||||||
|
git config user.email "asger@weircon.dk"
|
||||||
|
git add PKGBUILD .SRCINFO
|
||||||
|
if git diff --staged --quiet; then
|
||||||
|
echo "No changes — nothing to push."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git commit -m "Update to ${{ steps.version.outputs.version }}"
|
||||||
|
git push -u origin master
|
||||||
23
packaging/aur/PKGBUILD
Normal file
23
packaging/aur/PKGBUILD
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Maintainer: Asger Geel Weirsoe <asger@weircon.dk>
|
||||||
|
pkgname=pi3-smart-workspace
|
||||||
|
pkgver=0.0.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Switch i3 workspaces based on which output your mouse cursor is on"
|
||||||
|
arch=('any')
|
||||||
|
url="https://gitea.weircon.dk/agw/pi3-smart-workspace"
|
||||||
|
license=('Apache-2.0')
|
||||||
|
depends=('python' 'i3-wm' 'python-i3ipc' 'python-pynput')
|
||||||
|
makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-wheel')
|
||||||
|
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/$pkgname"
|
||||||
|
python -m build --wheel --no-isolation
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/$pkgname"
|
||||||
|
python -m installer --destdir="$pkgdir" dist/*.whl
|
||||||
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user