Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/Release_AUR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release AUR

on:
workflow_dispatch:
push:
tags:
- "v*"

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
container: archlinux@sha256:3406a568f45d68f0bef35dc80b3eacec8bda59b0292b2e50d5932ba1667f20cf
steps:
- name: Install build dependencies
run: pacman -Syu --noconfirm base-devel cargo

- name: Check out release
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Build package
run: |
useradd --create-home builder
chown -R builder:builder "$GITHUB_WORKSPACE"
runuser -u builder -- sh -c 'cd packaging/aur && makepkg --cleanbuild --clean --nodeps'

publish:
needs: validate
runs-on: ubuntu-latest
container: archlinux@sha256:3406a568f45d68f0bef35dc80b3eacec8bda59b0292b2e50d5932ba1667f20cf
steps:
- name: Check out release
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Validate release version
shell: bash
run: |
set -euo pipefail
package_version=$(bash -c 'source packaging/aur/PKGBUILD; printf "%s" "$pkgver"')
driver_version=$(bash -c 'source packaging/aur/PKGBUILD; printf "%s" "$_driverver"')
cli_version=$(awk -F ' *= *' '$1 == "version" { gsub(/"/, "", $2); print $2; exit }' cli/Cargo.toml)
root_driver_version=$(awk -F= '$1 == "pkgver" { print $2; exit }' PKGBUILD)

if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
release_version=$package_version
else
release_version=${GITHUB_REF_NAME#v}
fi

test "$release_version" = "$package_version"
test "$release_version" = "$cli_version"
test "$driver_version" = "$root_driver_version"

- name: Install publishing dependencies
run: pacman -Syu --noconfirm base-devel git openssh

- name: Publish package
shell: bash
env:
AUR_EMAIL: ${{ secrets.AUR_EMAIL }}
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
AUR_USERNAME: ${{ secrets.AUR_USERNAME }}
run: |
set -euo pipefail

install -d -m 700 "$HOME/.ssh"
printf '%s\n' "$AUR_SSH_KEY" > "$HOME/.ssh/aur"
chmod 600 "$HOME/.ssh/aur"
ssh-keyscan -t rsa,ecdsa,ed25519 aur.archlinux.org > "$HOME/.ssh/known_hosts"

fingerprints=$(ssh-keygen -lf "$HOME/.ssh/known_hosts" -E sha256)
for expected in \
'SHA256:RFzBCUItH9LZS0cKB5UE6ceAYhBD5C8GeOBip8Z11+4' \
'SHA256:uTa/0PndEgPZTf76e1DFqXKJEXKsn7m9ivhLQtzGOCI' \
'SHA256:5s5cIyReIfNNVGRFdDbe3hdYiI5OelHGpw2rOUud3Q8'; do
case "$fingerprints" in
*"$expected"*) ;;
*) printf 'Missing trusted AUR host key: %s\n' "$expected" >&2; exit 1 ;;
esac
done

cat > "$HOME/.ssh/config" <<'EOF'
Host aur.archlinux.org
IdentityFile ~/.ssh/aur
IdentitiesOnly yes
StrictHostKeyChecking yes
EOF
chmod 600 "$HOME/.ssh/config" "$HOME/.ssh/known_hosts"

git clone ssh://aur@aur.archlinux.org/maccel-dkms.git /tmp/maccel-dkms
cp packaging/aur/PKGBUILD packaging/aur/maccel.install packaging/aur/LICENSE /tmp/maccel-dkms/
package_version=$(bash -c 'source packaging/aur/PKGBUILD; printf "%s" "$pkgver"')
(
cd /tmp/maccel-dkms
makepkg --printsrcinfo > .SRCINFO
git config user.name "$AUR_USERNAME"
git config user.email "$AUR_EMAIL"
git add PKGBUILD .SRCINFO maccel.install LICENSE
if ! git diff --cached --quiet; then
git commit -m "Release maccel-dkms ${package_version}"
git push origin master
fi
)
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ use crate::params::Param;
3. `git add -A && git commit -m "Bump CLI version to x.y.z"`
4. `git tag v<x.y.z> && git push origin v<x.y.z>`

**AUR release:**
1. Update `packaging/aur/PKGBUILD` with the release and driver versions.
2. Update its source checksum.
3. Define `AUR_USERNAME`, `AUR_EMAIL`, and `AUR_SSH_KEY` repository secrets.
4. Push the matching `v<version>` tag; `.github/workflows/Release_AUR.yml` builds and publishes the package.

## 6. Commit Messages

- Short subject line (<50 chars), imperative mood
Expand Down
12 changes: 12 additions & 0 deletions packaging/aur/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Copyright (C) 2026 Gnarus-G

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
53 changes: 53 additions & 0 deletions packaging/aur/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maintainer: Gnarus-G <Gnarus-G at users dot noreply dot github dot com>

pkgname=maccel-dkms
_pkgname=maccel
pkgver=0.7.0
pkgrel=1
_driverver=0.6.0
pkgdesc="Mouse acceleration driver and kernel module for Linux."
arch=("x86_64")
url="https://www.maccel.org/"
license=("GPL-2.0-or-later")

install=maccel.install
depends=("dkms")
makedepends=("cargo")

options=(!debug !lto)

_srcname="${_pkgname}-${pkgver}"
source=("${_srcname}.tar.gz::https://github.com/Gnarus-G/maccel/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=("6f75f51ac07e44d0345063d2e0040ed32cae258dbae8cb597cf8c5a6abcea550")

prepare() {
export RUSTUP_TOOLCHAIN=stable

platform="$(rustc -vV | sed -n 's/host: //p')"
cargo fetch --locked --target "${platform}" --manifest-path="${srcdir}/${_srcname}/Cargo.toml"
}

build() {
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
export RUSTFLAGS="${RUSTFLAGS} --remap-path-prefix=${srcdir}=."

cargo build --bin maccel --release --frozen --manifest-path="${srcdir}/${_srcname}/Cargo.toml"
}

package() {
install -Dm 644 "${srcdir}/${_srcname}/maccel.sysusers" "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf"
install -Dm 644 "${srcdir}/${_srcname}/dkms.conf" "${pkgdir}/usr/src/${_pkgname}-${_driverver}/dkms.conf"

DRIVER_CFLAGS=$(echo ${DEBUG_CFLAGS} | sed -e "s/\//\\\\\//g")
sed -e "s/@_PKGNAME@/${_pkgname}/" \
-e "s/@PKGVER@/${_driverver}/" \
-e "s/@DRIVER_CFLAGS@/'${DRIVER_CFLAGS}'/" \
-i "${pkgdir}/usr/src/${_pkgname}-${_driverver}/dkms.conf"

cp -r "${srcdir}/${_srcname}/driver/." "${pkgdir}/usr/src/${_pkgname}-${_driverver}/"
install -Dm 755 "${srcdir}/target/release/maccel" "${pkgdir}/usr/bin/maccel"
install -Dm 644 "${srcdir}/${_srcname}/udev_rules/99-maccel.rules" "${pkgdir}/usr/lib/udev/rules.d/99-maccel.rules"
install -Dm 755 "${srcdir}/${_srcname}/udev_rules/maccel_param_ownership_and_resets" "${pkgdir}/usr/lib/udev/maccel_param_ownership_and_resets"
install -Dm 644 "${srcdir}/${_srcname}/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}
16 changes: 16 additions & 0 deletions packaging/aur/maccel.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
post_install() {
echo ''
echo ' Add yourself to the "maccel" group and install the module!'
echo ' usermod -aG maccel $USER;'
echo ' modprobe maccel;'
echo ''
}

post_upgrade() {
echo ''
echo ' Remember to reload the module!'
echo ' rmmod maccel && modprobe maccel'
echo ''
}

# post_remove() { }
Loading