Skip to content

Commit 93b8574

Browse files
committed
ci: update workflows to generate .SRCINFO automatically
- Changed permissions to allow write access in build-and-publish workflow. - Added step to commit generated .SRCINFO in build-and-publish workflow. - Updated monitor-upstream workflow to remove .SRCINFO from commit. - Updated upstream scripts to note that .SRCINFO will be generated by build-and-publish workflow.
1 parent 83554cc commit 93b8574

4 files changed

Lines changed: 37 additions & 11 deletions

File tree

.github/workflows/build-and-publish.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
default: false
2121

2222
permissions:
23-
contents: read
23+
contents: write
2424

2525
jobs:
2626
detect-changed-packages:
@@ -75,6 +75,37 @@ jobs:
7575
namcap: true
7676
srcinfo: true
7777

78+
- name: Commit generated .SRCINFO
79+
run: |
80+
# Configure Git
81+
git config user.name "github-actions[bot]"
82+
git config user.email "github-actions[bot]@users.noreply.github.com"
83+
84+
# Check if .SRCINFO was generated and differs from repo
85+
if [[ -f "pkgs/${{ matrix.package }}/.SRCINFO" ]]; then
86+
git add "pkgs/${{ matrix.package }}/.SRCINFO"
87+
88+
if ! git diff --cached --quiet; then
89+
git commit -m "ci: generate .SRCINFO for ${{ matrix.package }}
90+
91+
Automated .SRCINFO generation via build-and-publish workflow.
92+
93+
Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
94+
95+
# Pull and push
96+
git pull --rebase origin main || {
97+
echo "Failed to rebase, attempting merge" >&2
98+
git rebase --abort
99+
git pull --no-rebase origin main
100+
}
101+
git push origin main
102+
else
103+
echo ".SRCINFO is already up to date"
104+
fi
105+
else
106+
echo "Warning: .SRCINFO not found after build" >&2
107+
fi
108+
78109
- name: Upload build artifacts
79110
uses: actions/upload-artifact@v4
80111
with:

.github/workflows/monitor-upstream.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
for pkg in $(echo "${packages}" | jq -r '.[]'); do
6666
echo "Checking ${pkg}..."
6767
if scripts/update-package.sh "${pkg}" ${force_flag}; then
68-
if git diff --quiet "pkgs/${pkg}/PKGBUILD" "pkgs/${pkg}/.SRCINFO" 2>/dev/null; then
68+
if git diff --quiet "pkgs/${pkg}/PKGBUILD" 2>/dev/null; then
6969
echo "No changes detected for ${pkg}"
7070
else
7171
echo "Updates detected for ${pkg}"
@@ -103,7 +103,7 @@ jobs:
103103
104104
# Commit updates
105105
for pkg in "${updated_packages[@]}"; do
106-
git add "pkgs/${pkg}/PKGBUILD" "pkgs/${pkg}/.SRCINFO"
106+
git add "pkgs/${pkg}/PKGBUILD"
107107
108108
# Extract version from PKGBUILD
109109
new_version=$(awk -F'= *' '$1=="pkgver"{print $2; exit}' "pkgs/${pkg}/PKGBUILD")
@@ -114,6 +114,7 @@ jobs:
114114
git commit -m "ci: update ${pkg} to ${new_version}
115115
116116
Automated upstream version detection via monitor-upstream workflow.
117+
.SRCINFO will be generated by build-and-publish workflow.
117118
118119
Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
119120
done

pkgs/kdenlive-appimage-pure/upstream.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,5 @@ pkg_update_files() {
5656
sed -i "s|^source_x86_64=.*|source_x86_64=(\"${filename}::${url}\")|" "${pkgbuild}"
5757
sed -i "s/^${hash_algo}sums_x86_64=.*/${hash_algo}sums_x86_64=('${checksum}')/" "${pkgbuild}"
5858

59-
(
60-
cd "${PKG_DIR}"
61-
makepkg --printsrcinfo > .SRCINFO
62-
)
59+
# Note: .SRCINFO will be generated by build-and-publish workflow
6360
}

pkgs/linuxqq-appimage-wayland/upstream.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,5 @@ pkg_update_files() {
9595

9696
echo "Warning: Only x86_64 checksum updated. Please verify aarch64 manually." >&2
9797

98-
(
99-
cd "${PKG_DIR}"
100-
makepkg --printsrcinfo > .SRCINFO
101-
)
98+
# Note: .SRCINFO will be generated by build-and-publish workflow
10299
}

0 commit comments

Comments
 (0)