summaryrefslogtreecommitdiff
path: root/.forgejo/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.forgejo/workflows')
-rw-r--r--.forgejo/workflows/build-kernel.yml100
-rw-r--r--.forgejo/workflows/kernel-update-check.yml75
2 files changed, 135 insertions, 40 deletions
diff --git a/.forgejo/workflows/build-kernel.yml b/.forgejo/workflows/build-kernel.yml
index 56b47cb..8d5c1ea 100644
--- a/.forgejo/workflows/build-kernel.yml
+++ b/.forgejo/workflows/build-kernel.yml
@@ -1,4 +1,4 @@
-name: Build linux-raveos
+name: Build linux-raveos kernel
on:
push:
@@ -8,24 +8,106 @@ on:
- 'linux-raveos/**'
workflow_dispatch:
+concurrency:
+ group: raveos-kernel-build
+ cancel-in-progress: true
+
jobs:
build:
- runs-on: ubuntu-latest
+ runs-on: iso-builder
+
steps:
- name: Checkout
uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Install build dependencies
+ run: |
+ set -euo pipefail
+ sudo pacman -S --needed --noconfirm \
+ base-devel clang llvm lld bc binutils cpio gettext \
+ libelf openssl pahole perl python rust rust-bindgen \
+ rust-src xxhash xz zlib zstd
+
+ - name: Clone core repo
+ run: |
+ set -euo pipefail
+ rm -rf /tmp/raveos-core-repo
+ git clone --depth 1 git@git.rp1.hu:RaveOS/raveos-core-repo.git /tmp/raveos-core-repo
+ mkdir -p /tmp/builtpkgs
+
+ - name: Check if already built
+ id: check
+ run: |
+ set -euo pipefail
+ CORE="/tmp/raveos-core-repo/x86_64"
+ PKGVER=$(grep '^pkgver=' linux-raveos/PKGBUILD | cut -d= -f2)
+ PKGREL=$(grep '^pkgrel=' linux-raveos/PKGBUILD | cut -d= -f2)
+ EPOCH=$(grep '^epoch=' linux-raveos/PKGBUILD | cut -d= -f2 || echo "")
+ if [ -n "$EPOCH" ]; then
+ FULLVER="${EPOCH}:${PKGVER}-${PKGREL}"
+ else
+ FULLVER="${PKGVER}-${PKGREL}"
+ fi
+ echo "PKGVER=$PKGVER" >> $GITHUB_OUTPUT
+ echo "PKGREL=$PKGREL" >> $GITHUB_OUTPUT
+ if ls "$CORE"/linux-raveos-gcc-${PKGVER}-${PKGREL}-*.pkg.tar.zst 2>/dev/null | grep -q .; then
+ echo "SKIP=yes" >> $GITHUB_OUTPUT
+ echo "linux-raveos ${FULLVER} mar bent van -> skip"
+ else
+ echo "SKIP=no" >> $GITHUB_OUTPUT
+ echo "linux-raveos ${FULLVER} build indul..."
+ fi
- name: Build linux-raveos
+ if: steps.check.outputs.SKIP == 'no'
run: |
+ set -euo pipefail
cd linux-raveos
+ rm -f *.pkg.tar.zst || true
makepkg -s --noconfirm
+ cp -v linux-raveos-gcc-*.pkg.tar.zst /tmp/builtpkgs/
+ cp -v linux-raveos-gcc-headers-*.pkg.tar.zst /tmp/builtpkgs/
- - name: Upload to core repo
+ - name: Publish to core repo
+ if: steps.check.outputs.SKIP == 'no'
run: |
- for pkg in linux-raveos/*.pkg.tar.zst; do
- curl -s -X POST \
- -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
- -F "file=@$pkg" \
- "https://git.rp1.hu/api/packages/RaveOS/arch/push"
+ set -euo pipefail
+ CORE="/tmp/raveos-core-repo/x86_64"
+ mkdir -p "$CORE"
+
+ BUILT=$(ls /tmp/builtpkgs/*.pkg.tar.zst 2>/dev/null || true)
+ if [ -z "$BUILT" ]; then
+ echo "Nincs csomag -> kihagyva"
+ exit 0
+ fi
+
+ cd /tmp/raveos-core-repo
+ git config user.name "Forgejo Actions"
+ git config user.email "actions@forgejo.local"
+
+ for pkg in $BUILT; do
+ PKGFILE=$(basename "$pkg")
+ PKGNAME=$(echo "$PKGFILE" | sed 's/-[0-9][^-]*-[^-]*-[^-]*\.pkg\.tar\.zst$//')
+ rm -f "$CORE/${PKGNAME}-"*.pkg.tar.zst* 2>/dev/null || true
+ cp -v "$pkg" "$CORE/"
done
- echo "Csomagok feltoltve"
+
+ git add -A
+ git commit -m "kernel: linux-raveos ${{ steps.check.outputs.PKGVER }}-${{ steps.check.outputs.PKGREL }}"
+ git push origin main
+
+ TAG="vrepo-$(date +%Y%m%d-%H%M%S)"
+ git tag -a "$TAG" -m "linux-raveos ${GITHUB_SHA:0:7}"
+ git push origin "$TAG"
+
+ echo "::notice title=Kernel published::linux-raveos ${{ steps.check.outputs.PKGVER }}-${{ steps.check.outputs.PKGREL }}"
+
+ - name: Cleanup
+ if: always()
+ run: |
+ sudo rm -rf /tmp/builtpkgs || true
+ sudo rm -rf /tmp/raveos-core-repo || true
+ sudo rm -rf linux-raveos/src linux-raveos/pkg || true
+ df -h
diff --git a/.forgejo/workflows/kernel-update-check.yml b/.forgejo/workflows/kernel-update-check.yml
index 673d1ab..f28a8f9 100644
--- a/.forgejo/workflows/kernel-update-check.yml
+++ b/.forgejo/workflows/kernel-update-check.yml
@@ -7,16 +7,19 @@ on:
jobs:
check-update:
- runs-on: ubuntu-latest
+ runs-on: iso-builder
+
steps:
- name: Checkout
uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
- name: Check CachyOS kernel version
id: check
run: |
- # Aktualis CachyOS kernel verzio lekerdezese
- LATEST=$(curl -s "https://api.github.com/repos/CachyOS/linux/tags" \
+ set -euo pipefail
+ LATEST=$(curl -fsSL --retry 3 "https://api.github.com/repos/CachyOS/linux/tags" \
| python3 -c "
import sys, json, re
tags = json.load(sys.stdin)
@@ -34,51 +37,61 @@ jobs:
print(f'TAGREL={latest[3]}')
")
echo "$LATEST" >> $GITHUB_OUTPUT
- echo "Latest CachyOS: $LATEST"
+ echo "Legfrissebb CachyOS: $LATEST"
- - name: Read current version from PKGBUILD
+ - name: Read current version
id: current
run: |
+ set -euo pipefail
MAJOR=$(grep '^_major=' linux-raveos/PKGBUILD | cut -d= -f2)
MINOR=$(grep '^_minor=' linux-raveos/PKGBUILD | cut -d= -f2)
TAGREL=$(grep '^_tagrel=' linux-raveos/PKGBUILD | cut -d= -f2)
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
echo "TAGREL=$TAGREL" >> $GITHUB_OUTPUT
- echo "Current: $MAJOR.$MINOR-$TAGREL"
+ echo "Jelenlegi: ${MAJOR}.${MINOR}-${TAGREL}"
- - name: Check if update needed
+ - name: Frissites szukseges?
id: needsupdate
run: |
+ set -euo pipefail
NEW="${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
CUR="${{ steps.current.outputs.MAJOR }}.${{ steps.current.outputs.MINOR }}-${{ steps.current.outputs.TAGREL }}"
if [ "$NEW" != "$CUR" ]; then
echo "UPDATE=yes" >> $GITHUB_OUTPUT
- echo "Frissites szukseges: $CUR -> $NEW"
+ echo "Frissites: $CUR -> $NEW"
else
echo "UPDATE=no" >> $GITHUB_OUTPUT
- echo "Nincs frissites, aktualis: $CUR"
+ echo "Aktualis, nincs frissites: $CUR"
fi
- - name: Check if PR already exists
+ - name: PR mar letezik?
id: prcheck
if: steps.needsupdate.outputs.UPDATE == 'yes'
run: |
+ set -euo pipefail
BRANCH="update/kernel-${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
- EXISTS=$(curl -s \
+ EXISTS=$(curl -fsSL \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
- "https://git.rp1.hu/api/v1/repos/${{ github.repository }}/pulls?state=open&head=$BRANCH" \
- | python3 -c "import sys,json; pulls=json.load(sys.stdin); print('yes' if pulls else 'no')")
+ "https://git.rp1.hu/api/v1/repos/${{ github.repository }}/pulls?state=open" \
+ | python3 -c "
+ import sys, json
+ pulls = json.load(sys.stdin)
+ branch = '${BRANCH}'
+ found = any(p.get('head', {}).get('label', '').endswith(branch) for p in pulls)
+ print('yes' if found else 'no')
+ ")
echo "EXISTS=$EXISTS" >> $GITHUB_OUTPUT
echo "PR letezik: $EXISTS"
- - name: Create update branch
+ - name: Update branch letrehozasa
if: steps.needsupdate.outputs.UPDATE == 'yes' && steps.prcheck.outputs.EXISTS == 'no'
run: |
+ set -euo pipefail
+ BRANCH="update/kernel-${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
+
git config user.name "RaveOS Bot"
git config user.email "bot@raveos.hu"
-
- BRANCH="update/kernel-${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
git checkout -b "$BRANCH"
# PKGBUILD frissitese
@@ -86,15 +99,14 @@ jobs:
sed -i "s/^_minor=.*/_minor=${{ steps.check.outputs.MINOR }}/" linux-raveos/PKGBUILD
sed -i "s/^_tagrel=.*/_tagrel=${{ steps.check.outputs.TAGREL }}/" linux-raveos/PKGBUILD
- # CachyOS config letoltese
- SRCNAME="cachyos-${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
- curl -sL "https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos/config" \
- -o linux-raveos/config.new
+ # Uj CachyOS config letoltese
+ curl -fsSL --retry 3 \
+ "https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos/config" \
+ -o linux-raveos/config
- # ZRAM es NTSYNC builtin megtartasa
- sed -i 's/^CONFIG_ZRAM=m$/CONFIG_ZRAM=y/' linux-raveos/config.new
- sed -i 's/^CONFIG_NTSYNC=m$/CONFIG_NTSYNC=y/' linux-raveos/config.new
- mv linux-raveos/config.new linux-raveos/config
+ # RaveOS modositasok visszarakasa a configba
+ sed -i 's/^CONFIG_ZRAM=m$/CONFIG_ZRAM=y/' linux-raveos/config
+ sed -i 's/^CONFIG_NTSYNC=m$/CONFIG_NTSYNC=y/' linux-raveos/config
git add linux-raveos/PKGBUILD linux-raveos/config
git commit -m "update: linux-raveos kernel ${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
@@ -102,21 +114,22 @@ jobs:
git remote set-url origin "https://bot:${{ secrets.FORGEJO_TOKEN }}@git.rp1.hu/RaveOS/RaveOS-PKGBUILD.git"
git push origin "$BRANCH"
- - name: Open Pull Request
+ - name: PR nyitasa
if: steps.needsupdate.outputs.UPDATE == 'yes' && steps.prcheck.outputs.EXISTS == 'no'
run: |
+ set -euo pipefail
BRANCH="update/kernel-${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
- NEW_VER="${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
- CUR_VER="${{ steps.current.outputs.MAJOR }}.${{ steps.current.outputs.MINOR }}-${{ steps.current.outputs.TAGREL }}"
+ NEW="${{ steps.check.outputs.MAJOR }}.${{ steps.check.outputs.MINOR }}-${{ steps.check.outputs.TAGREL }}"
+ CUR="${{ steps.current.outputs.MAJOR }}.${{ steps.current.outputs.MINOR }}-${{ steps.current.outputs.TAGREL }}"
- curl -s -X POST \
+ curl -fsSL -X POST \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/json" \
"https://git.rp1.hu/api/v1/repos/${{ github.repository }}/pulls" \
-d "{
- \"title\": \"kernel update: $CUR_VER -> $NEW_VER\",
- \"head\": \"$BRANCH\",
+ \"title\": \"kernel update: ${CUR} -> ${NEW}\",
+ \"head\": \"${BRANCH}\",
\"base\": \"main\",
- \"body\": \"Automatikus kernel frissites.\n\n- Regi verzio: \`$CUR_VER\`\n- Uj verzio: \`$NEW_VER\`\n\nEllenorizd a config diff-et merge elott.\"
+ \"body\": \"Automatikus kernel frissites.\n\n- Regi verzio: \`${CUR}\`\n- Uj verzio: \`${NEW}\`\n\nEllenorizd a config diff-et merge elott. Merge utan automatikusan elindul a build.\"
}"
echo "PR megnyitva: $BRANCH -> main"