Skip to content

Commit 24c3054

Browse files
committed
Use Cloudflare R2 for hosting APT and RPM repos
1 parent 5904713 commit 24c3054

File tree

4 files changed

+24
-78
lines changed

4 files changed

+24
-78
lines changed

.github/workflows/ci-linux.yml

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -231,65 +231,51 @@ jobs:
231231
runs-on: ubuntu-latest
232232
if: startsWith(github.ref, 'refs/tags/')
233233
steps:
234-
- uses: actions/checkout@v4
235-
236234
- name: Download all build artifacts
237235
uses: actions/download-artifact@v4
238236
with:
239237
path: './artifacts'
240238

241-
- name: Download RELEASE_TAG_WITHOUT_PREFIX artifact
242-
uses: actions/download-artifact@v4
243-
with:
244-
name: release_tag_without_prefix
245-
path: './'
246-
247-
- name: Set RELEASE_TAG_WITHOUT_PREFIX env var
248-
run:
249-
echo "RELEASE_TAG_WITHOUT_PREFIX=$(cat
250-
./release_tag_without_prefix.txt)" >> $GITHUB_ENV
251-
252239
- name: Install createrepo_c
253240
run: |
254241
sudo apt-get update
255242
sudo apt-get install -y createrepo-c
256243
257244
- name: Prepare RPM repository
258245
run: |
259-
cd ./publish/rpm
260-
rm -rf Packages repodata
261-
mkdir -p Packages
246+
mkdir dist
247+
cd dist
248+
mkdir Packages
262249
263-
find ../../artifacts -type f -name "*.rpm" -exec cp {} Packages/ \;
250+
find ../artifacts -type f -name "*.rpm" -exec cp {} Packages/ \;
264251
createrepo_c --update .
265252
266-
- name: Set up Node.js (for Firebase CLI)
267-
uses: actions/setup-node@v3
268-
with:
269-
node-version: '18.x'
270-
271-
- name: Install Firebase CLI
272-
run: npm install -g firebase-tools
253+
- name: Install s3cmd
254+
run: sudo apt-get install -y s3cmd
273255

274-
- name: Create service account key
275-
working-directory: ./publish/rpm
256+
- name: Configure s3cmd for Cloudflare R2
276257
run: |
277-
echo '${{ secrets.RPM_FIREBASE_SERVICE_ACCOUNT }}' > /tmp/firebase-service-account.json
258+
cat > ~/.s3cfg <<EOF
259+
[default]
260+
access_key = ${{ secrets.R2_ACCESS_KEY_ID }}
261+
secret_key = ${{ secrets.R2_SECRET_ACCESS_KEY }}
262+
host_base = ${{ secrets.R2_ENDPOINT }}
263+
host_bucket = ${{ secrets.R2_ENDPOINT }}
264+
use_https = True
265+
signature_v2 = False
266+
EOF
278267
279-
- name: Deploy RPM repo to Firebase Hosting
280-
working-directory: ./publish/rpm
281-
env:
282-
GOOGLE_APPLICATION_CREDENTIALS: /tmp/firebase-service-account.json
283-
run: firebase deploy --only hosting
268+
- name: Sync RPM repo to Cloudflare R2
269+
working-directory: dist
270+
run: |
271+
s3cmd sync --delete-removed ./ s3://${{ secrets.R2_BUCKET_RPM }}/
284272
285273
release_deb:
286274
name: Publish DEB package
287275
needs: release_github
288276
runs-on: ubuntu-latest
289277
if: startsWith(github.ref, 'refs/tags/')
290278
steps:
291-
- uses: actions/checkout@v4
292-
293279
- name: Download all build artifacts
294280
uses: actions/download-artifact@v4
295281
with:
@@ -302,12 +288,12 @@ jobs:
302288
303289
- name: Prepare APT repository
304290
run: |
305-
mkdir -p ./publish/deb
306-
cd ./publish/deb
291+
mkdir dist
292+
cd dist
307293
308294
# Copy .deb packages into pool
309295
mkdir -p pool/main
310-
find ../../artifacts -type f -name "*.deb" -exec cp {} pool/main/ \;
296+
find ../artifacts -type f -name "*.deb" -exec cp {} pool/main/ \;
311297
312298
# Normalize package names
313299
dpkg-name pool/main/*.deb
@@ -338,6 +324,6 @@ jobs:
338324
EOF
339325
340326
- name: Sync DEB repo to Cloudflare R2
341-
working-directory: ./publish/deb
327+
working-directory: dist
342328
run: |
343329
s3cmd sync --delete-removed ./ s3://${{ secrets.R2_BUCKET_APT }}/

publish/rpm/.firebaserc

Lines changed: 0 additions & 5 deletions
This file was deleted.

publish/rpm/firebase.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

publish/rpm/index.html

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)