-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c43950
commit d9db3ec
Showing
3 changed files
with
91 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,80 @@ | ||
name: Upload AUR | ||
|
||
on: | ||
release: | ||
types: [created] | ||
on: push | ||
#on: | ||
# release: | ||
# types: [created] | ||
|
||
jobs: | ||
build: | ||
# tpi-bin: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout Code | ||
# uses: actions/checkout@v4 | ||
# - name: generate PKGBUILD | ||
# run: | | ||
# cp scripts/ci/PKGBUILD.bin ./PKGBUILD | ||
# PACKAGE_NAME=$(grep '^name =' Cargo.toml | sed 's/name = "\(.*\)"/\1/')-bin | ||
# 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 | ||
# echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||
# echo "PKG_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV | ||
# - name: Validate package | ||
# uses: heyhusen/archlinux-package-action@v2 | ||
# with: | ||
# updpkgsums: true | ||
# srcinfo: true | ||
# - name: Publish AUR package | ||
# uses: KSXGitHub/github-actions-deploy-aur@v3 | ||
# with: | ||
# pkgname: ${{ env.PKG_NAME }} | ||
# pkgbuild: ./PKGBUILD | ||
# commit_username: 'Github automation' | ||
# commit_email: '[email protected]' | ||
# ssh_private_key: ${{ secrets.AUR_DEPLOY_KEY }} | ||
# commit_message: Update package to ${{ env.VERSION }} | ||
|
||
tpi-src: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: generate PKGBUILD | ||
run: | | ||
cp scripts/ci/PKGBUILD . | ||
cp scripts/ci/PKGBUILD ./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 | ||
sed -i "2i pkgname=${PACKAGE_NAME}" PKGBUILD | ||
sed -i "3i pkgver=${VERSION}" PKGBUILD | ||
sed -i "4i pkgdesc='${DESCRIPTION}'" PKGBUILD | ||
sed -i "5i source=(\"git+https://github.com/turing-machines/tpi.git#tag=v${VERSION}\")" PKGBUILD | ||
echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||
echo "PKG_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV | ||
install=$(cat scripts/ci/install) | ||
echo -e "package() {\n" >> PKGBUILD | ||
echo -e " TARGET=\$CARCH-unknown-linux-gnu\n" >> PKGBUILD | ||
echo -e "$install\n" >> PKGBUILD | ||
echo -e "}\n" >> PKGBUILD | ||
- run: cat ./PKGBUILD | ||
- name: Validate package | ||
uses: heyhusen/archlinux-package-action@v2 | ||
with: | ||
updpkgsums: true | ||
srcinfo: true | ||
- name: Publish AUR package | ||
uses: KSXGitHub/github-actions-deploy-aur@v3 | ||
with: | ||
pkgname: ${{ env.PKG_NAME }} | ||
pkgbuild: ./PKGBUILD | ||
commit_username: 'Github automation' | ||
commit_email: '[email protected]' | ||
ssh_private_key: ${{ secrets.AUR_DEPLOY_KEY }} | ||
commit_message: Update package to ${{ env.VERSION }} | ||
# - name: Publish AUR package | ||
# uses: KSXGitHub/github-actions-deploy-aur@v3 | ||
# with: | ||
# pkgname: ${{ env.PKG_NAME }} | ||
# pkgbuild: ./PKGBUILD | ||
# commit_username: 'Github automation' | ||
# commit_email: '[email protected]' | ||
# ssh_private_key: ${{ secrets.AUR_DEPLOY_KEY }} | ||
# commit_message: Update package to ${{ env.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
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") | ||
makedepends=('cargo') | ||
arch=('any') | ||
|
||
package() { | ||
tar -xzf "${srcdir}/tpi-${CARCH}-unknown-linux-gnu.tar.gz" -C "${pkgdir}" | ||
prepare() { | ||
cd $pkgname | ||
export RUSTUP_TOOLCHAIN=stable | ||
cargo fetch --locked --target "$CARCH-unknown-linux-gnu" | ||
} | ||
|
||
build() { | ||
cd $pkgname | ||
export RUSTUP_TOOLCHAIN=stable | ||
export CARGO_TARGET_DIR=target | ||
cargo build --frozen --release | ||
} | ||
|
||
check() { | ||
cd $pkgname | ||
export RUSTUP_TOOLCHAIN=stable | ||
cargo test --frozen | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}" | ||
} |