-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (65 loc) · 1.98 KB
/
publish-aur.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
name: Publish AUR Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
pkgver:
required: false
type: string
pkgrel:
default: 1
required: false
type: number
dryrun:
description: 'Do not push changes to aur'
default: true
required: true
type: boolean
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
container:
image: archlinux:base-devel
steps:
- name: Upgrade system
run: |
pacman -Syu --needed --noconfirm git openssh pacman-contrib namcap
sed -i '/E_ROOT/d' /usr/bin/makepkg
- name: Setup ssh
run: |
mkdir -vpm700 ~root/.ssh && cd "$_"
install -m700 <(echo '${{ secrets.AUR_SSH_PRIVATE_KEY }}') id_rsa
install -m700 <(ssh-keyscan -H aur.archlinux.org) known_hosts
- name: Fetch from aur
run: |
git clone ssh://[email protected]/maa-cli.git
- name: Patch pkgver
run: |
cd maa-cli
ref=${{ inputs.pkgver || github.ref }}
sed -i "/^pkgver=/cpkgver=${ref#refs/tags/v}" PKGBUILD
sed -i "/^pkgrel=/cpkgrel=${{ inputs.pkgrel || 1 }}" PKGBUILD
- name: Makepkg
run: |
cd maa-cli
updpkgsums
makepkg -s --noconfirm
namcap *.pkg.tar.zst
makepkg --printsrcinfo > .SRCINFO
- name: Commit changes
run: |
cd maa-cli
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff --staged >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
git commit -m "github-actions[bot]: Upgrade to ${{ inputs.pkgver || github.ref_name }}"
git push origin --verbose ${{ inputs.dryrun && '--dry-run' || '' }}
- uses: actions/upload-artifact@v3
with:
name: package
path: maa-cli/*.pkg.tar.zst