blob: 698a57ba19c48f61971b1ae1fc4f45a66c507f89 (
plain)
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
|
name: Update pacman repo DB (repo-add)
on:
push:
tags:
- "v*"
- "vrepo-*"
workflow_dispatch:
jobs:
repoadd:
runs-on: iso-builder
steps:
- name: Checkout repository via SSH
run: |
git clone --depth 1 git@git.rp1.hu:RaveOS/raveos-core-repo.git "${GITHUB_WORKSPACE}"
- name: Install repo-add (pacman-contrib)
run: |
set -euo pipefail
sudo pacman -S --needed --noconfirm pacman-contrib
- name: Rebuild repo DB files
run: |
set -euo pipefail
REPO_NAME="raveos-core-repo"
if [ ! -d "x86_64" ]; then
echo "ERROR: x86_64 directory not found!"
exit 1
fi
cd x86_64
rm -f "${REPO_NAME}.db" \
"${REPO_NAME}.files" \
"${REPO_NAME}.db.tar.xz" \
"${REPO_NAME}.files.tar.xz" \
"${REPO_NAME}.db.tar.xz.old" \
"${REPO_NAME}.files.tar.xz.old" || true
repo-add "${REPO_NAME}.db.tar.xz" ./*.pkg.tar.zst
ln -sf "${REPO_NAME}.db.tar.xz" "${REPO_NAME}.db"
ln -sf "${REPO_NAME}.files.tar.xz" "${REPO_NAME}.files"
echo "=== DB files created ==="
ls -la | grep -E "${REPO_NAME}\.(db|files)"
- name: Commit and push updated DB files (to main)
run: |
set -euo pipefail
cd "${GITHUB_WORKSPACE}"
git config user.name "Forgejo Actions"
git config user.email "actions@forgejo.local"
git fetch origin main
git checkout -B main origin/main
git add x86_64/raveos-core-repo.db* x86_64/raveos-core-repo.files* || true
if git diff --staged --quiet; then
echo "No DB changes, nothing to commit."
exit 0
fi
git commit -m "Update pacman repo DB (repo-add)"
git push origin main
- name: Cleanup
if: always()
run: |
sudo rm -rf /var/cache/pacman/pkg/* || true
df -h
|