Skip to content

Commit 8479cbf

Browse files
committed
Push packages to repo
1 parent fdc5c25 commit 8479cbf

File tree

1 file changed

+151
-0
lines changed

1 file changed

+151
-0
lines changed

.github/workflows/ci.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,154 @@ jobs:
238238
tag: ${{ github.ref }}
239239
overwrite: true
240240
file_glob: true
241+
242+
repo-deb:
243+
name: Update Debian package repository
244+
needs: [release]
245+
runs-on: ubuntu-latest
246+
container: debian:sid
247+
steps:
248+
- name: Install dependencies
249+
run: |
250+
apt-get update
251+
apt-get install -y git
252+
253+
- name: Download artifacts
254+
uses: actions/download-artifact@v1
255+
with:
256+
name: debian-latest
257+
258+
- name: Update repository
259+
env:
260+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
261+
BRANCH_STAGING: u/staging
262+
GIT_REF: ${{ github.ref }}
263+
run: |
264+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
265+
266+
# clone package repository
267+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
268+
269+
# copy packages
270+
cp debian-latest/* repo/debian/
271+
cd repo/debian
272+
273+
# parse git tag from ref
274+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
275+
276+
# convert packages into references
277+
for pkg in $(find . -name '*.deb'); do
278+
echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
279+
rm $pkg
280+
done
281+
282+
# set git identity
283+
git config --global user.email "[email protected]"
284+
git config --global user.name "surfacebot"
285+
286+
# commit and push
287+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
288+
git switch -c "${update_branch}"
289+
git add .
290+
git commit -m "Update Debian secure-boot MOK"
291+
git push --set-upstream origin "${update_branch}"
292+
293+
repo-f31:
294+
name: Update Fedora 31 package repository
295+
needs: [release]
296+
runs-on: ubuntu-latest
297+
container: fedora:31
298+
steps:
299+
- name: Install dependencies
300+
run: |
301+
dnf install -y git findutils
302+
303+
- name: Download artifacts
304+
uses: actions/download-artifact@v1
305+
with:
306+
name: fedora-31-latest
307+
308+
- name: Update repository
309+
env:
310+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
311+
BRANCH_STAGING: u/staging
312+
GIT_REF: ${{ github.ref }}
313+
run: |
314+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
315+
316+
# clone package repository
317+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
318+
319+
# copy packages
320+
cp fedora-31-latest/* repo/fedora/f31
321+
cd repo/fedora/f31
322+
323+
# parse git tag from ref
324+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
325+
326+
# convert packages into references
327+
for pkg in $(find . -name '*.rpm'); do
328+
echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
329+
rm $pkg
330+
done
331+
332+
# set git identity
333+
git config --global user.email "[email protected]"
334+
git config --global user.name "surfacebot"
335+
336+
# commit and push
337+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
338+
git checkout -b "${update_branch}"
339+
git add .
340+
git commit -m "Update Fedora 31 secure-boot MOK"
341+
git push --set-upstream origin "${update_branch}"
342+
343+
repo-f30:
344+
name: Update Fedora 30 package repository
345+
needs: [release]
346+
runs-on: ubuntu-latest
347+
container: fedora:30
348+
steps:
349+
- name: Install dependencies
350+
run: |
351+
dnf install -y git findutils
352+
353+
- name: Download artifacts
354+
uses: actions/download-artifact@v1
355+
with:
356+
name: fedora-30-latest
357+
358+
- name: Update repository
359+
env:
360+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
361+
BRANCH_STAGING: u/staging
362+
GIT_REF: ${{ github.ref }}
363+
run: |
364+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
365+
366+
# clone package repository
367+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
368+
369+
# copy packages
370+
cp fedora-30-latest/* repo/fedora/f30
371+
cd repo/fedora/f30
372+
373+
# parse git tag from ref
374+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
375+
376+
# convert packages into references
377+
for pkg in $(find . -name '*.rpm'); do
378+
echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
379+
rm $pkg
380+
done
381+
382+
# set git identity
383+
git config --global user.email "[email protected]"
384+
git config --global user.name "surfacebot"
385+
386+
# commit and push
387+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
388+
git checkout -b "${update_branch}"
389+
git add .
390+
git commit -m "Update Fedora 30 secure-boot MOK"
391+
git push --set-upstream origin "${update_branch}"

0 commit comments

Comments
 (0)