From f1448228ea7f7e37d4bd505de8b3ab964498a558 Mon Sep 17 00:00:00 2001 From: Sven Rademakers Date: Mon, 4 Nov 2024 18:25:47 +0000 Subject: [PATCH] WIP --- .github/workflows/aur_upload.yml | 35 ++++++++++++++++++++++++++++++++ scripts/ci/PKGBUILD | 13 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/aur_upload.yml create mode 100644 scripts/ci/PKGBUILD diff --git a/.github/workflows/aur_upload.yml b/.github/workflows/aur_upload.yml new file mode 100644 index 0000000..69d3fc1 --- /dev/null +++ b/.github/workflows/aur_upload.yml @@ -0,0 +1,35 @@ +name: Upload AUR + +on: [push] +#on: +# release: +# types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: generate PKGBUILD + run: | + cp scripts/ci/PKGBUILD . + PACKAGE_NAME=$(grep '^name =' Cargo.toml | sed 's/name = "\(.*\)"/\1/') + VERSION=$(grep '^version =' Cargo.toml | sed 's/version = "\(.*\)"/\1/') + MAINTAINER=$(grep '^authors =' Cargo.toml | sed 's/authors = \[\s*"\(.*\)\s*"\]/\1/') + DESCRIPTION=$(grep '^description =' Cargo.toml | sed 's/description = "\(.*\)"/\1/') + sed -i "1i # Maintainer: ${MAINTAINER}" PKGBUILD + sed -i "s/^pkgname=.*/pkgname=${PACKAGE_NAME}/" PKGBUILD + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD + sed -i "s/^pkgdesc=.*/pkgdesc='${DESCRIPTION}'/" PKGBUILD + - name: Validate package + uses: heyhusen/archlinux-package-action@v2 + with: + updpkgsums: true + srcinfo: true + + - name: Upload Archive + uses: actions/upload-artifact@v4 + with: + name: test + path: PKGBUILD diff --git a/scripts/ci/PKGBUILD b/scripts/ci/PKGBUILD new file mode 100644 index 0000000..b07815d --- /dev/null +++ b/scripts/ci/PKGBUILD @@ -0,0 +1,13 @@ +pkgname= +pkgver= +pkgrel=1 +pkgdesc= +url=https://turingpi.com/ +license=('Apache') +arch=('x86_64' 'aarch64') +source_x86_64=("https://github.com/turing-machines/tpi/releases/download/v${pkgver}/tpi-x86_64-unknown-linux-gnu.tar.gz") +source_aarch64=("https://github.com/turing-machines/tpi/releases/download/v${pkgver}/tpi-aarch64-unknown-linux-gnu.tar.gz") + +package() { + tar -xzf "${srcdir}/tpi-${CARCH}-unknown-linux-gnu.tar.gz" -C "${pkgdir}" +}