diff --git a/.github/workflows/aur-publish.yml b/.github/workflows/aur-publish.yml new file mode 100644 index 0000000..ed5774e --- /dev/null +++ b/.github/workflows/aur-publish.yml @@ -0,0 +1,83 @@ +name: Publish to AUR + +on: + release: + types: [published] + workflow_dispatch: + inputs: + version: + description: "Version to publish (e.g. 0.2.5). Defaults to latest release." + required: false + +jobs: + aur-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Determine version + id: version + run: | + if [[ -n "${{ inputs.version }}" ]]; then + VERSION="${{ inputs.version }}" + else + VERSION="${GITHUB_REF_NAME#v}" + fi + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "Publishing version: ${VERSION}" + + - name: Download release assets and compute checksums + id: checksums + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ steps.version.outputs.version }} + run: | + tmpdir=$(mktemp -d) + + gh release download "v${VERSION}" \ + --pattern "linear-linux-${VERSION}-x86_64.AppImage" \ + --dir "${tmpdir}" || true + + gh release download "v${VERSION}" \ + --pattern "linear-linux-${VERSION}-arm64.AppImage" \ + --dir "${tmpdir}" || true + + if [[ -f "${tmpdir}/linear-linux-${VERSION}-x86_64.AppImage" ]]; then + SHA_X86=$(sha256sum "${tmpdir}/linear-linux-${VERSION}-x86_64.AppImage" | cut -d' ' -f1) + else + SHA_X86="SKIP" + fi + + if [[ -f "${tmpdir}/linear-linux-${VERSION}-arm64.AppImage" ]]; then + SHA_ARM=$(sha256sum "${tmpdir}/linear-linux-${VERSION}-arm64.AppImage" | cut -d' ' -f1) + else + SHA_ARM="SKIP" + fi + + echo "sha_x86=${SHA_X86}" >> "$GITHUB_OUTPUT" + echo "sha_arm=${SHA_ARM}" >> "$GITHUB_OUTPUT" + rm -rf "${tmpdir}" + + - name: Update PKGBUILD with new version and checksums + env: + VERSION: ${{ steps.version.outputs.version }} + SHA_X86: ${{ steps.checksums.outputs.sha_x86 }} + SHA_ARM: ${{ steps.checksums.outputs.sha_arm }} + run: | + cd aur + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD + sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD + sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA_X86}')/" PKGBUILD + sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA_ARM}')/" PKGBUILD + + - name: Publish to AUR + uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 + with: + pkgname: linear-linux-bin + pkgbuild: aur/PKGBUILD + commit_username: ${{ github.repository_owner }} + commit_email: ${{ github.repository_owner }}@users.noreply.github.com + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: "Update to ${{ steps.version.outputs.version }}" + force_push: true diff --git a/aur/.SRCINFO b/aur/.SRCINFO new file mode 100644 index 0000000..e6d5cdf --- /dev/null +++ b/aur/.SRCINFO @@ -0,0 +1,27 @@ +pkgbase = linear-linux-bin + pkgdesc = Unofficial Linux desktop client for Linear (linear.app) + pkgver = 0.2.5 + pkgrel = 1 + url = https://github.com/selimaj-dev/linear-linux + arch = x86_64 + arch = aarch64 + license = ISC + depends = gtk3 + depends = nss + depends = alsa-lib + depends = libxtst + depends = libxss + depends = at-spi2-core + optdepends = libappindicator-gtk3: tray icon support + provides = linear-linux + conflicts = linear-linux + conflicts = linear-desktop-bin + conflicts = linear-desktop-git + options = !strip + options = !debug + source_x86_64 = linear-linux-0.2.5-x86_64.AppImage::https://github.com/selimaj-dev/linear-linux/releases/download/v0.2.5/linear-linux-0.2.5-x86_64.AppImage + sha256sums_x86_64 = SKIP + source_aarch64 = linear-linux-0.2.5-arm64.AppImage::https://github.com/selimaj-dev/linear-linux/releases/download/v0.2.5/linear-linux-0.2.5-arm64.AppImage + sha256sums_aarch64 = SKIP + +pkgname = linear-linux-bin diff --git a/aur/PKGBUILD b/aur/PKGBUILD new file mode 100644 index 0000000..c103d76 --- /dev/null +++ b/aur/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: Radu Ursache +pkgname=linear-linux-bin +pkgver=0.2.5 +pkgrel=1 +pkgdesc="Unofficial Linux desktop client for Linear (linear.app)" +arch=('x86_64' 'aarch64') +url="https://github.com/selimaj-dev/linear-linux" +license=('ISC') +depends=('gtk3' 'nss' 'alsa-lib' 'libxtst' 'libxss' 'at-spi2-core') +optdepends=('libappindicator-gtk3: tray icon support') +provides=('linear-linux') +conflicts=('linear-linux' 'linear-desktop-bin' 'linear-desktop-git') +options=('!strip' '!debug') + +_appimage_x86_64="linear-linux-${pkgver}-x86_64.AppImage" +_appimage_aarch64="linear-linux-${pkgver}-arm64.AppImage" + +source_x86_64=("${_appimage_x86_64}::${url}/releases/download/v${pkgver}/${_appimage_x86_64}") +source_aarch64=("${_appimage_aarch64}::${url}/releases/download/v${pkgver}/${_appimage_aarch64}") + +# Updated after each release by CI — see .github/workflows/aur-publish.yml +sha256sums_x86_64=('SKIP') +sha256sums_aarch64=('SKIP') + +prepare() { + local _appimage + if [[ "$CARCH" == "x86_64" ]]; then + _appimage="${_appimage_x86_64}" + else + _appimage="${_appimage_aarch64}" + fi + + chmod +x "${srcdir}/${_appimage}" + "${srcdir}/${_appimage}" --appimage-extract + + # Fix permissions + chmod -R a+rX "${srcdir}/squashfs-root" +} + +package() { + # Install app files + install -d "${pkgdir}/opt/${pkgname}" + cp -a "${srcdir}/squashfs-root/." "${pkgdir}/opt/${pkgname}/" + + # Symlink executable + install -d "${pkgdir}/usr/bin" + ln -s "/opt/${pkgname}/AppRun" "${pkgdir}/usr/bin/linear-linux" + + # Desktop entry + install -Dm644 /dev/stdin "${pkgdir}/usr/share/applications/linear-linux.desktop" </dev/null || true +}