-
Notifications
You must be signed in to change notification settings - Fork 7
/
entrypoint.sh
executable file
·57 lines (37 loc) · 1.22 KB
/
entrypoint.sh
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
#!/bin/bash
set -o errexit -o pipefail -o nounset
NEW_RELEASE=${GITHUB_REF##*/v}
export HOME=/home/builder
echo "::group::Setup"
echo "Getting AUR SSH Public keys"
ssh-keyscan aur.archlinux.org >>$HOME/.ssh/known_hosts
echo "Writing SSH Private keys to file"
echo -e "${INPUT_SSH_PRIVATE_KEY//_/\\n}" >$HOME/.ssh/aur
chmod 600 $HOME/.ssh/aur*
echo "Setting up Git"
git config --global user.name "$INPUT_COMMIT_USERNAME"
git config --global user.email "$INPUT_COMMIT_EMAIL"
REPO_URL="ssh://[email protected]/${INPUT_PACKAGE_NAME}.git"
echo "Cloning repo"
cd /tmp
git clone "$REPO_URL"
cd "$INPUT_PACKAGE_NAME"
echo "Setting version: ${NEW_RELEASE}"
sed -i -E "s/pkgver=.*$/pkgver=${NEW_RELEASE}/" PKGBUILD
sed -i -E "s/pkgrel=.*$/pkgrel=1/" PKGBUILD
perl -i -0pe "s/sha256sums=[\s\S][^\)]*\)/$(makepkg -g 2>/dev/null)/" PKGBUILD
echo "::endgroup::Setup"
echo "::group::Build"
echo "Building and installing dependencies"
makepkg --noconfirm -s -c
echo "Updating SRCINFO"
makepkg --printsrcinfo >.SRCINFO
echo "::endgroup::Build"
echo "::group::Publish"
echo "Publishing new version"
# Update aur
git add PKGBUILD .SRCINFO
git commit --allow-empty -m "Update to $NEW_RELEASE"
git push
echo "Publish Done"
echo "::endgroup::Publish"