Skip to content

Commit f89487a

Browse files
committed
ci: add manual APT repo update workflow
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent b98ce51 commit f89487a

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/update-apt.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Update APT Repository
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (without v prefix, e.g. 0.1.0)'
8+
required: true
9+
10+
jobs:
11+
update-apt-repo:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install tools
19+
run: sudo apt-get update && sudo apt-get install -y reprepro
20+
21+
- name: Configure AWS CLI for R2
22+
run: |
23+
aws configure set aws_access_key_id "${{ secrets.R2_ACCESS_KEY_ID }}"
24+
aws configure set aws_secret_access_key "${{ secrets.R2_SECRET_ACCESS_KEY }}"
25+
aws configure set default.region auto
26+
env:
27+
AWS_DEFAULT_OUTPUT: json
28+
29+
- name: Import GPG signing key
30+
run: echo "${{ secrets.APT_GPG_PRIVATE_KEY }}" | gpg --batch --import
31+
32+
- name: Download .deb from GitHub Release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
VERSION="${{ inputs.version }}"
37+
mkdir -p artifacts
38+
gh release download "v${VERSION}" --pattern "*.deb" --dir artifacts
39+
40+
- name: Sync existing APT repo from R2
41+
run: |
42+
mkdir -p repo
43+
aws s3 sync "s3://mcpmux-apt/" repo/ \
44+
--endpoint-url "${{ secrets.R2_ENDPOINT }}" \
45+
|| echo "No existing repo (first run)"
46+
47+
- name: Update APT repo with new packages
48+
run: |
49+
cp -r scripts/apt-repo/conf repo/
50+
51+
for deb in artifacts/*.deb; do
52+
echo "Adding: $deb"
53+
reprepro -b repo --section utils --priority optional includedeb stable "$deb"
54+
done
55+
56+
gpg --armor --export hello@mcpmux.com > repo/key.gpg
57+
58+
- name: Sync APT repo back to R2
59+
run: |
60+
aws s3 sync repo/ "s3://mcpmux-apt/" \
61+
--endpoint-url "${{ secrets.R2_ENDPOINT }}" \
62+
--delete

0 commit comments

Comments
 (0)