Add Forgejo Actions workflows and fix [breadway] repo URL
- .forgejo/workflows/mirror.yml: mirrors every push/tag to GitHub - .forgejo/workflows/package.yml: builds PKGBUILD on tag and publishes bos-settings to the Forgejo Arch package registry (distrib=breadway) - iso/pacman.conf: replace placeholder repo.breadway.dev with the actual Forgejo package registry URL Requires two Forgejo secrets: GITHUB_MIRROR_TOKEN — GitHub PAT with repo push scope FORGEJO_TOKEN — Forgejo token with package:write scope
This commit is contained in:
parent
a028e7462a
commit
baff024016
3 changed files with 70 additions and 3 deletions
20
.forgejo/workflows/mirror.yml
Normal file
20
.forgejo/workflows/mirror.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
name: Mirror to GitHub
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['**']
|
||||||
|
tags: ['**']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: [self-hosted, hestia]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Push to GitHub
|
||||||
|
run: |
|
||||||
|
git remote add github \
|
||||||
|
"https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/Breadway/bos.git"
|
||||||
|
git push github --mirror
|
||||||
46
.forgejo/workflows/package.yml
Normal file
46
.forgejo/workflows/package.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
name: Build and publish package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
runs-on: [self-hosted, hestia]
|
||||||
|
container:
|
||||||
|
image: archlinux:latest
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set version
|
||||||
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: pacman -Syu --noconfirm base-devel git rust cargo gtk4 glib2
|
||||||
|
|
||||||
|
- name: Create builder user
|
||||||
|
run: useradd -m builder
|
||||||
|
|
||||||
|
- name: Prepare source
|
||||||
|
run: |
|
||||||
|
git archive --format=tar.gz \
|
||||||
|
--prefix=bos-settings-${VERSION}/ \
|
||||||
|
HEAD > packaging/arch/bos-settings-${VERSION}.tar.gz
|
||||||
|
SHA=$(sha256sum packaging/arch/bos-settings-${VERSION}.tar.gz | awk '{print $1}')
|
||||||
|
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" packaging/arch/PKGBUILD
|
||||||
|
sed -i "s/^sha256sums=.*/sha256sums=('${SHA}')/" packaging/arch/PKGBUILD
|
||||||
|
cp -r . /home/builder/src
|
||||||
|
chown -R builder:builder /home/builder/src
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: su builder -c "cd /home/builder/src/packaging/arch && makepkg -sf --noconfirm"
|
||||||
|
|
||||||
|
- name: Publish to Forgejo registry
|
||||||
|
run: |
|
||||||
|
PKG=$(find /home/builder/src/packaging/arch -name '*.pkg.tar.zst' | head -1)
|
||||||
|
curl -fsS -X PUT \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
--upload-file "${PKG}" \
|
||||||
|
"https://git.breadway.dev/api/packages/breadway/arch/push?distrib=breadway"
|
||||||
|
|
@ -30,9 +30,10 @@ Include = /etc/pacman.d/mirrorlist
|
||||||
# bread ecosystem packages (bread, breadbar, breadbox, breadcrumbs, breadpad,
|
# bread ecosystem packages (bread, breadbar, breadbox, breadcrumbs, breadpad,
|
||||||
# bos-settings).
|
# bos-settings).
|
||||||
#
|
#
|
||||||
# TODO: Replace this URL with the actual hosted repo before building.
|
# Packages are published here by the Forgejo Actions package.yml workflow
|
||||||
# See: https://github.com/Breadway/repo for setup instructions.
|
# in each repo. See git.breadway.dev/api/packages/breadway/arch for the
|
||||||
|
# package registry.
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
[breadway]
|
[breadway]
|
||||||
SigLevel = Optional TrustAll
|
SigLevel = Optional TrustAll
|
||||||
Server = https://repo.breadway.dev/$arch
|
Server = https://git.breadway.dev/api/packages/breadway/arch/breadway/$arch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue