-
Notifications
You must be signed in to change notification settings - Fork 0
239 lines (214 loc) · 9.41 KB
/
repo.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: Arch AUR Repository Build
on:
push:
pull_request:
schedule:
- cron: '1 7 * * 0'
jobs:
build-x86_64:
runs-on: ubuntu-latest
name: Build on x86_64
container:
image: archlinux:latest
options: --privileged
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PKGEXT: .pkg.tar.zst
steps:
- name: Set variables
id: set-vars
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M')"
echo "::set-output name=repo-id::$(echo ${{ github.repository }} | sed 's/\//-/g')"
- name: Store private key
id: gpg
run: |
echo "$GPG_PRIVATE_KEY" > ${GITHUB_WORKSPACE}/gpg.key
- name: Prepare repo
id: prepare
run: |
echo "::set-output name=arch::$(uname -m)"
curl --output repo.key https://raw.githubusercontent.com/benalexau/aur-repo/master/repo.key
pacman-key --init
pacman-key --add repo.key
pacman-key --lsign-key 71BDE43D3404BE41F65E5F640A5DAECE044E226C
rm repo.key
pacman -Syyu --noconfirm
pacman -S --noconfirm base-devel sudo
echo 'auruser ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/auruser
useradd -m auruser
sudo -u auruser gpg --batch --import ${GITHUB_WORKSPACE}/gpg.key
rm ${GITHUB_WORKSPACE}/gpg.key
curl --output python2-key.asc https://raw.githubusercontent.com/benalexau/aur-repo/master/python2-key.asc
sudo -u auruser gpg --batch --import python2-key.asc
cd /tmp
curl --output aurutils.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/aurutils.tar.gz
tar xf aurutils.tar.gz
chmod -R 777 /tmp/aurutils
cd aurutils
sudo -u auruser makepkg --syncdeps --noconfirm
ls -l
pacman -U --noconfirm aurutils-*.pkg.*
cp -v /tmp/aurutils/aurutils-*.pkg.* ${GITHUB_WORKSPACE}
export REPO_IDENTIFIER="${{ steps.set-vars.outputs.repo-id }}"
repo-add ${GITHUB_WORKSPACE}/${REPO_IDENTIFIER}.db.tar.gz ${GITHUB_WORKSPACE}/aurutils-*.pkg.*
chmod -R 777 ${GITHUB_WORKSPACE}
ls -l ${GITHUB_WORKSPACE}
echo "# local repository (required by aur tools to be set up)" >> /etc/pacman.conf
echo "[${REPO_IDENTIFIER}]" >> /etc/pacman.conf
echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf
echo "Server = file://${GITHUB_WORKSPACE} " >> /etc/pacman.conf
pacman -Sy --noconfirm
pacman -S --noconfirm python-pip python-tensorflow python-pillow
export OPENSSL_LIB_DIR=/usr/lib
export OPENSSL_INCLUDE_DIR=/usr/include/openssl
pacman -S --noconfirm java-runtime-common
archlinux-java unset
pacman -S --noconfirm jdk-openjdk
for pkg in archlinux-java-run photoprism-bin etesync-dav jellyfin ledger-udev ledger-live-bin paru zoom google-chrome ipmiview jackett sonarr radarr laminar mediamtx-bin vial-appimage reposilite code-marketplace
do
echo "### Package ${pkg}"
sudo -u auruser aur sync --sign -A --noconfirm --noview --database ${REPO_IDENTIFIER} --root ${GITHUB_WORKSPACE} ${pkg} || echo "!!! Package ${pkg} failed"
done
chmod -R 777 ${GITHUB_WORKSPACE}
- name: Remove symbolic links
run: |
cd ${GITHUB_WORKSPACE}
ls -al
rm -v ${{ steps.set-vars.outputs.repo-id }}.db ${{ steps.set-vars.outputs.repo-id }}.files
cp -v ${{ steps.set-vars.outputs.repo-id }}.db.tar.gz ${{ steps.set-vars.outputs.repo-id }}.db
cp -v ${{ steps.set-vars.outputs.repo-id }}.files.tar.gz ${{ steps.set-vars.outputs.repo-id }}.files
rm -fv build-log.txt *.sh
ls -al
- name: Remove release
uses: cb80/delrel@latest
with:
tag: ${{ steps.prepare.outputs.arch }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.prepare.outputs.arch }}
name: Arch Linux AUR Build ${{ github.run_number }} from ${{ steps.set-vars.outputs.date }} for ${{ steps.prepare.outputs.arch }}
body: |
To use this repository, please append the following to `/etc/pacman.conf`:
```
[${{ steps.set-vars.outputs.repo-id }}]
SigLevel = Required
Server = https://github.com/${{ github.repository }}/releases/download/${{ steps.prepare.outputs.arch }}
```
You must also trust the signing key:
```
sudo pacman-key --recv-keys 71BDE43D3404BE41F65E5F640A5DAECE044E226C --keyserver hkp://keyserver.ubuntu.com
sudo pacman-key --lsign-key 71BDE43D3404BE41F65E5F640A5DAECE044E226C
```
artifacts: |
${{ github.workspace }}/*
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
build-arm:
runs-on: ubuntu-latest
name: Build on ${{ matrix.arch }}
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
strategy:
matrix:
include:
- arch: aarch64
- arch: armv7
steps:
- name: Set variables
id: set-vars
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M')"
echo "::set-output name=repo-id::$(echo ${{ github.repository }} | sed 's/\//-/g')"
- name: Store private key
id: gpg
run: |
echo "$GPG_PRIVATE_KEY" > ${{ runner.temp }}/gpg.key
- name: Prepare repo
id: prepare
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: archarm_latest
githubToken: ${{ secrets.GITHUB_TOKEN }}
dockerRunArgs: |
--volume "${{ runner.temp }}:/workspace"
env: |
PKGEXT: .pkg.tar.zst
REPO_IDENTIFIER: ${{ steps.set-vars.outputs.repo-id }}
shell: /bin/sh
run: |
echo "::set-output name=arch::$(uname -m)"
curl --output repo.key https://raw.githubusercontent.com/benalexau/aur-repo/master/repo.key
pacman-key --init
pacman-key --add repo.key
pacman-key --lsign-key 71BDE43D3404BE41F65E5F640A5DAECE044E226C
rm repo.key
pacman -Syyu --noconfirm
pacman -S --noconfirm base-devel sudo
echo 'auruser ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/auruser
useradd -m auruser
sudo -u auruser gpg --batch --import /workspace/gpg.key
rm /workspace/gpg.key
cd /tmp
curl --output aurutils.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/aurutils.tar.gz
tar xf aurutils.tar.gz
chmod -R 777 /tmp/aurutils
cd aurutils
sudo -u auruser makepkg --syncdeps --noconfirm
ls -l
pacman -U --noconfirm aurutils-*.pkg.*
cp -v /tmp/aurutils/aurutils-*.pkg.* /workspace
repo-add /workspace/${REPO_IDENTIFIER}.db.tar.gz /workspace/aurutils-*.pkg.*
chmod -R 777 /workspace
ls -l /workspace
echo "# local repository (required by aur tools to be set up)" >> /etc/pacman.conf
echo "[${REPO_IDENTIFIER}]" >> /etc/pacman.conf
echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf
echo "Server = file:///workspace " >> /etc/pacman.conf
pacman -Sy --noconfirm
pacman -S --noconfirm jre17-openjdk-headless
sudo -u auruser aur sync --sign -A --noconfirm --noview --database ${REPO_IDENTIFIER} --root /workspace archlinux-java-run
chmod -R 777 /workspace
- name: Remove symbolic links
run: |
pwd
echo Runner tmp: "${{ runner.temp }}"
ls -l
cd "${{ runner.temp }}"
ls -al
rm -v ${{ steps.set-vars.outputs.repo-id }}.db ${{ steps.set-vars.outputs.repo-id }}.files
cp -v ${{ steps.set-vars.outputs.repo-id }}.db.tar.gz ${{ steps.set-vars.outputs.repo-id }}.db
cp -v ${{ steps.set-vars.outputs.repo-id }}.files.tar.gz ${{ steps.set-vars.outputs.repo-id }}.files
rm -fv build-log.txt *.sh
ls -al
- name: Remove release
uses: cb80/delrel@latest
with:
tag: ${{ steps.prepare.outputs.arch }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.prepare.outputs.arch }}
name: Arch Linux ARM AUR Build ${{ github.run_number }} from ${{ steps.set-vars.outputs.date }} for ${{ steps.prepare.outputs.arch }}
body: |
To use this repository, please append the following to `/etc/pacman.conf`:
```
[${{ steps.set-vars.outputs.repo-id }}]
SigLevel = Required
Server = https://github.com/${{ github.repository }}/releases/download/${{ steps.prepare.outputs.arch }}
```
You must also trust the signing key:
```
sudo pacman-key --recv-keys 71BDE43D3404BE41F65E5F640A5DAECE044E226C --keyserver hkp://keyserver.ubuntu.com
sudo pacman-key --lsign-key 71BDE43D3404BE41F65E5F640A5DAECE044E226C
```
artifacts: |
${{ runner.temp }}/*
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}