Skip to content

Commit d1557d9

Browse files
committed
APT repo update
1 parent 12bfea1 commit d1557d9

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

.github/workflows/build-on-push.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,42 @@ jobs:
3636
- name: Checkout
3737
uses: actions/checkout@v4
3838

39+
- name: Checkout repo
40+
uses: actions/checkout@v4
41+
with:
42+
repository: ameridroid/apt-repo
43+
path: /repo
44+
3945
- uses: actions/download-artifact@v4
4046
with:
4147
name: ${{ github.event.repository.name }}
4248

43-
- name: Prepare package list
44-
id: prepare_packages
49+
- name: Extract artifacts
50+
run: |
51+
unzip ${{ github.event.repository.name }}.zip -d /tmp/
52+
53+
- name: Import GPG key
54+
env:
55+
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
56+
run: |
57+
echo "$GPG_KEY" | gpg --import
58+
gpg --list-keys
59+
60+
- name: Upload packages to APT repository
4561
run: |
46-
debs=$(ls ./*.deb | tr '\n' ',' | sed 's/,$//')
47-
echo "packages=$debs" >> $GITHUB_ENV
62+
cd /repo
63+
for package in /tmp/*.deb; do
64+
for codename in bookworm-testing trixie-testing; do
65+
reprepro --ignore=wrongdistribution includedeb $codename $package
66+
done
67+
done
4868
49-
- name: Upload to APT repository
50-
uses: ameriDroid/apt-repo/.github/actions/upload-to-repo@main
51-
with:
52-
codename: "bookworm-testing"
53-
package-paths: "${{ env.packages }}"
69+
- name: Push updated repository to main branch
70+
run: |
71+
cd /repo
72+
git config --global user.name "GitHub Actions"
73+
git config --global user.email "[email protected]"
74+
git add -A
75+
git commit -m "Update ${{ github.event.repository.name}}"
76+
git push origin main
77+

0 commit comments

Comments
 (0)