-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (89 loc) · 3.6 KB
/
aur_upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Upload AUR
on: push
#on:
# release:
# types: [created]
jobs:
# 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
strategy:
matrix:
name:
- master
- git
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: generate PKGBUILD
run: |
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/')
if [[ ${{ matrix.name }} == "master" ]]; then
TAG=""
PACKAGE_NAME=${PACKAGE_NAME}-git
else
TAG="#tag=v${VERSION}"
fi
sed -i "1i # Maintainer: ${MAINTAINER}" 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}\")" PKGBUILD
install=$(cat scripts/ci/install)
echo "package() {" >> PKGBUILD
echo " TARGET=\$CARCH-unknown-linux-gnu" >> PKGBUILD
echo "$install" >> PKGBUILD
echo -e "}\n" >> PKGBUILD
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "PKG_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
- run: cat ./PKGBUILD
- name: Validate package
uses: heyhusen/[email protected]
with:
flags: '-d -o'
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 }}