add Gitea Actions release workflow, switch AUR to gpupaper-bin
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||||
+8
-7
@@ -1,13 +1,11 @@
|
|||||||
pkgbase = gpupaper-git
|
pkgbase = gpupaper-bin
|
||||||
pkgdesc = Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu)
|
pkgdesc = Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu)
|
||||||
pkgver = r1.f53340a
|
pkgver = 0.1.0
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://prosjekt.klingenbergbygg.no/bl/gpupaper
|
url = https://prosjekt.klingenbergbygg.no/bl/gpupaper
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
arch = aarch64
|
arch = aarch64
|
||||||
license = MIT
|
license = MIT
|
||||||
makedepends = rust
|
|
||||||
makedepends = cargo
|
|
||||||
depends = wayland
|
depends = wayland
|
||||||
depends = libglvnd
|
depends = libglvnd
|
||||||
optdepends = vulkan-icd-loader: Vulkan backend (generic loader)
|
optdepends = vulkan-icd-loader: Vulkan backend (generic loader)
|
||||||
@@ -15,7 +13,10 @@ pkgbase = gpupaper-git
|
|||||||
optdepends = nvidia-utils: NVIDIA Vulkan/OpenGL support
|
optdepends = nvidia-utils: NVIDIA Vulkan/OpenGL support
|
||||||
provides = gpupaper
|
provides = gpupaper
|
||||||
conflicts = gpupaper
|
conflicts = gpupaper
|
||||||
source = gpupaper::git+https://prosjekt.klingenbergbygg.no/bl/gpupaper.git
|
conflicts = gpupaper-git
|
||||||
sha256sums = SKIP
|
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
|
||||||
|
|||||||
+10
-27
@@ -1,49 +1,32 @@
|
|||||||
# Maintainer: Bendik Aagaard Lynghaug <bendik.lynghaug@gmail.com>
|
# Maintainer: Bendik Aagaard Lynghaug <bendik.lynghaug@gmail.com>
|
||||||
pkgname=gpupaper-git
|
pkgname=gpupaper-bin
|
||||||
pkgver=r1.f53340a
|
pkgver=0.1.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu)"
|
pkgdesc="Wayland layer-surface wallpaper runner powered by GLSL/WGSL fragment shaders (wgpu)"
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
url="https://prosjekt.klingenbergbygg.no/bl/gpupaper"
|
url="https://prosjekt.klingenbergbygg.no/bl/gpupaper"
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
depends=('wayland' 'libglvnd')
|
depends=('wayland' 'libglvnd')
|
||||||
makedepends=('rust' 'cargo')
|
|
||||||
optdepends=(
|
optdepends=(
|
||||||
'vulkan-icd-loader: Vulkan backend (generic loader)'
|
'vulkan-icd-loader: Vulkan backend (generic loader)'
|
||||||
'mesa: open-source Vulkan/OpenGL for AMD, Intel, and Raspberry Pi'
|
'mesa: open-source Vulkan/OpenGL for AMD, Intel, and Raspberry Pi'
|
||||||
'nvidia-utils: NVIDIA Vulkan/OpenGL support'
|
'nvidia-utils: NVIDIA Vulkan/OpenGL support'
|
||||||
)
|
)
|
||||||
provides=('gpupaper')
|
provides=('gpupaper')
|
||||||
conflicts=('gpupaper')
|
conflicts=('gpupaper' 'gpupaper-git')
|
||||||
source=("gpupaper::git+https://prosjekt.klingenbergbygg.no/bl/gpupaper.git")
|
|
||||||
sha256sums=('SKIP')
|
|
||||||
|
|
||||||
pkgver() {
|
# Update these URLs and checksums with each release.
|
||||||
cd "$srcdir/gpupaper"
|
# Binaries are hosted at: https://prosjekt.klingenbergbygg.no/bl/gpupaper-releases
|
||||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
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')
|
||||||
prepare() {
|
sha256sums_aarch64=('SKIP')
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/gpupaper"
|
install -Dm755 gpupaper "$pkgdir/usr/bin/gpupaper"
|
||||||
|
|
||||||
install -Dm755 "target/release/gpupaper" "$pkgdir/usr/bin/gpupaper"
|
|
||||||
|
|
||||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||||
|
|
||||||
# Example shaders
|
|
||||||
install -dm755 "$pkgdir/usr/share/gpupaper/shaders"
|
install -dm755 "$pkgdir/usr/share/gpupaper/shaders"
|
||||||
install -Dm644 shaders/*.frag "$pkgdir/usr/share/gpupaper/shaders/"
|
install -Dm644 shaders/*.frag "$pkgdir/usr/share/gpupaper/shaders/"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user