File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 default : false
2121
2222permissions :
23- contents : read
23+ contents : write
2424
2525jobs :
2626 detect-changed-packages :
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 :
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments