v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-18 00:30:40 -07:00

chore: add aur actions

This commit is contained in:
eeeXun 2023-02-09 16:51:51 +08:00
parent d833495ab2
commit b0e3d6f764
2 changed files with 52 additions and 0 deletions

34
.github/workflows/aur.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: aur
on:
workflow_run:
workflows: ["release"]
types:
- completed
jobs:
aur:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set env VERSION
run: |
git fetch --tags
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
- name: Replace PKGVER, SHA256SUMS_X86_64 in PKGBUILD
run: |
sed -i "s/PKGVER/$(echo ${{ env.VERSION }} | cut -c2-)/g" build/PKGBUILD
wget https://github.com/eeeXun/GTT/releases/download/${{ env.VERSION }}/gtt-linux-amd64.tar.gz
sed -i "s/SHA256SUMS_X86_64/$(sha256sum gtt-linux-amd64.tar.gz | awk '{print $1}')/g" build/PKGBUILD
- name: Publish to the AUR
uses: KSXGitHub/github-actions-deploy-aur@v2.2.5
with:
pkgname: gtt-bin
pkgbuild: build/PKGBUILD
commit_message: Update to ${{ env.VERSION }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

18
build/PKGBUILD Normal file
View File

@ -0,0 +1,18 @@
# Maintainer: eeeXun <sdes96303@gmail.com>
pkgname=gtt-bin
pkgver=PKGVER
pkgrel=1
pkgdesc='Translate TUI in Golang'
url='https://github.com/eeeXun/GTT'
license=('MIT')
source_x86_64=("gtt-$pkgver-linux-amd64.tar.gz::${url}/releases/download/v${pkgver}/gtt-linux-amd64.tar.gz")
arch=('x86_64')
depends=('alsa-lib')
optdepends=('xclip: for clipboard support on X11' 'wl-clipboard: for clipboard support on Wayland')
provides=('gtt')
sha256sums_x86_64=('SHA256SUMS_X86_64')
package() {
install -Dm755 "gtt" "$pkgdir/usr/bin/gtt"
}