From 3541618c84958e0cfd6ad4c1c5f0e47e2e7dc0e2 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Mon, 8 Jun 2026 21:19:58 +0200 Subject: [PATCH] add Gitea Actions release workflow, switch AUR to gpupaper-bin Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 99 ++++++++++++++++++++++++++++++++++++ aur/.SRCINFO | 15 +++--- aur/PKGBUILD | 37 ++++---------- 3 files changed, 117 insertions(+), 34 deletions(-) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..dfbd494 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,99 @@ +name: Release + +on: + push: + tags: + - 'v*' + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - arch: x86_64 + target: x86_64-unknown-linux-gnu + - arch: aarch64 + target: aarch64-unknown-linux-gnu + + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libwayland-dev pkg-config + + - name: Install cross-compilation tools (aarch64 only) + if: matrix.arch == 'aarch64' + run: | + sudo apt-get install -y gcc-aarch64-linux-gnu + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-${{ matrix.arch }}-cargo-${{ hashFiles('Cargo.lock') }} + + - name: Build + run: cargo build --release --target ${{ matrix.target }} + + - name: Package + run: | + VERSION="${{ gitea.ref_name }}" + TARBALL="gpupaper-${VERSION}-${{ matrix.arch }}.tar.gz" + mkdir -p pkg + cp target/${{ matrix.target }}/release/gpupaper pkg/ + cp -r shaders pkg/ + cp LICENSE pkg/ + tar -czf "${TARBALL}" -C pkg . + sha256sum "${TARBALL}" > "${TARBALL}.sha256" + echo "TARBALL=${TARBALL}" >> $GITHUB_ENV + + # --------------------------------------------------------------------------- + # Upload to a PUBLIC Gitea repo used as a release mirror. + # Set RELEASE_REPO in repository secrets to "user/public-releases-repo". + # The token needs write access to that repo. + # --------------------------------------------------------------------------- + - name: Create release in mirror repo (if not already exists) + if: matrix.arch == 'x86_64' + run: | + curl -sX POST \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Content-Type: application/json" \ + "${{ gitea.server_url }}/api/v1/repos/${{ secrets.RELEASE_REPO }}/releases" \ + -d "{\"tag_name\":\"${{ gitea.ref_name }}\",\"name\":\"${{ gitea.ref_name }}\",\"body\":\"\"}" \ + --fail-with-body || true # ignore if release already exists + + - name: Get release ID from mirror repo + run: | + RELEASE_ID=$(curl -sX GET \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + "${{ gitea.server_url }}/api/v1/repos/${{ secrets.RELEASE_REPO }}/releases/tags/${{ gitea.ref_name }}" \ + | jq -r '.id') + echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV + + - name: Upload binary asset + run: | + curl -sX POST \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Content-Type: application/octet-stream" \ + "${{ gitea.server_url }}/api/v1/repos/${{ secrets.RELEASE_REPO }}/releases/${{ env.RELEASE_ID }}/assets?name=${{ env.TARBALL }}" \ + --data-binary "@${{ env.TARBALL }}" --fail-with-body + + - name: Upload checksum + run: | + curl -sX POST \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Content-Type: text/plain" \ + "${{ gitea.server_url }}/api/v1/repos/${{ secrets.RELEASE_REPO }}/releases/${{ env.RELEASE_ID }}/assets?name=${{ env.TARBALL }}.sha256" \ + --data-binary "@${{ env.TARBALL }}.sha256" --fail-with-body diff --git a/aur/.SRCINFO b/aur/.SRCINFO index 86148bc..87fce46 100644 --- a/aur/.SRCINFO +++ b/aur/.SRCINFO @@ -1,13 +1,11 @@ -pkgbase = gpupaper-git +pkgbase = gpupaper-bin pkgdesc = Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu) - pkgver = r1.f53340a + pkgver = 0.1.0 pkgrel = 1 url = https://prosjekt.klingenbergbygg.no/bl/gpupaper arch = x86_64 arch = aarch64 license = MIT - makedepends = rust - makedepends = cargo depends = wayland depends = libglvnd optdepends = vulkan-icd-loader: Vulkan backend (generic loader) @@ -15,7 +13,10 @@ pkgbase = gpupaper-git optdepends = nvidia-utils: NVIDIA Vulkan/OpenGL support provides = gpupaper conflicts = gpupaper - source = gpupaper::git+https://prosjekt.klingenbergbygg.no/bl/gpupaper.git - sha256sums = SKIP + conflicts = gpupaper-git + source_x86_64 = gpupaper-v0.1.0-x86_64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases/releases/download/v0.1.0/gpupaper-v0.1.0-x86_64.tar.gz + sha256sums_x86_64 = SKIP + source_aarch64 = gpupaper-v0.1.0-aarch64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases/releases/download/v0.1.0/gpupaper-v0.1.0-aarch64.tar.gz + sha256sums_aarch64 = SKIP -pkgname = gpupaper-git +pkgname = gpupaper-bin diff --git a/aur/PKGBUILD b/aur/PKGBUILD index bd8f57e..5c6801a 100644 --- a/aur/PKGBUILD +++ b/aur/PKGBUILD @@ -1,49 +1,32 @@ # Maintainer: Bendik Aagaard Lynghaug -pkgname=gpupaper-git -pkgver=r1.f53340a +pkgname=gpupaper-bin +pkgver=0.1.0 pkgrel=1 pkgdesc="Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu)" arch=('x86_64' 'aarch64') url="https://prosjekt.klingenbergbygg.no/bl/gpupaper" license=('MIT') depends=('wayland' 'libglvnd') -makedepends=('rust' 'cargo') optdepends=( 'vulkan-icd-loader: Vulkan backend (generic loader)' 'mesa: open-source Vulkan/OpenGL for AMD, Intel, and Raspberry Pi' 'nvidia-utils: NVIDIA Vulkan/OpenGL support' ) provides=('gpupaper') -conflicts=('gpupaper') -source=("gpupaper::git+https://prosjekt.klingenbergbygg.no/bl/gpupaper.git") -sha256sums=('SKIP') +conflicts=('gpupaper' 'gpupaper-git') -pkgver() { - cd "$srcdir/gpupaper" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" -} - -prepare() { - cd "$srcdir/gpupaper" - export RUSTUP_TOOLCHAIN=stable - cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')" -} - -build() { - cd "$srcdir/gpupaper" - export RUSTUP_TOOLCHAIN=stable - export CARGO_TARGET_DIR=target - cargo build --offline --release -} +# Update these URLs and checksums with each release. +# Binaries are hosted at: https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases +source_x86_64=("gpupaper-v${pkgver}-x86_64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases/releases/download/v${pkgver}/gpupaper-v${pkgver}-x86_64.tar.gz") +source_aarch64=("gpupaper-v${pkgver}-aarch64.tar.gz::https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases/releases/download/v${pkgver}/gpupaper-v${pkgver}-aarch64.tar.gz") +sha256sums_x86_64=('SKIP') +sha256sums_aarch64=('SKIP') package() { - cd "$srcdir/gpupaper" - - install -Dm755 "target/release/gpupaper" "$pkgdir/usr/bin/gpupaper" + install -Dm755 gpupaper "$pkgdir/usr/bin/gpupaper" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - # Example shaders install -dm755 "$pkgdir/usr/share/gpupaper/shaders" install -Dm644 shaders/*.frag "$pkgdir/usr/share/gpupaper/shaders/" }