forgejo: enable build.yml

This commit is contained in:
Antoine Martin 2024-10-06 17:31:03 -04:00
parent ce4cfd4d02
commit cb20b06d49
Signed by: forge
GPG key ID: D62A472A4AA7D541
6 changed files with 58 additions and 197 deletions

View file

@ -0,0 +1,55 @@
name: Kernel Release
on:
push:
tags:
- 'v*'
jobs:
release-build:
name: Build
runs-on: aarch64
container:
image: debian:bookworm
steps:
- name: Setup build environment
run: |
cat /etc/os-release
cp /etc/apt/sources.list.d/debian.sources /etc/apt/sources.list.d/debian-src.sources
sed 's/Types: deb/Types: deb-src/' -i /etc/apt/sources.list.d/debian-src.sources
apt-get update
apt-get install -y devscripts debhelper equivs git nodejs sudo
sudo hostname host.docker.internal
- name: Checkout Sources
uses: actions/checkout@v4
with:
path: pve-kernel-thunderx
- name: Checkout submodules
run: git -C pve-kernel-thunderx submodule update --init --depth 16 --jobs 3
- name: Build Kernel
run: |
cd pve-kernel-thunderx
debian/rules debian/control
sudo mk-build-deps --tool 'apt-get --no-install-recommends --yes' --install debian/control
debuild --no-lintian -ePVE* --jobs=auto -b -uc -us
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: debs
path: "*.deb"
release-deploy:
needs: [release-build]
runs-on: aarch64
container:
image: alpine:latest
steps:
- name: Setting up environment
run: apk add nodejs curl findutils
- name: Package download
uses: actions/download-artifact@v3
- name: Package deployment
run: |
find -name '*.deb' > deb.list
while read file; do
curl --user ${{ vars.FORGE_REPO_USER }}:${{ secrets.FORGE_REPO_PRIVKEY }} --upload-file "$file" https://ayakael.net/api/packages/forge/debian/pool/bookworm/main/upload
done < deb.list

1
.github/FUNDING.yml vendored
View file

@ -1 +0,0 @@
custom: https://www.buymeacoffee.com/fabianishere

View file

@ -1,87 +0,0 @@
name: Kernel Release
on:
pull_request:
types: [closed]
branches:
- v*
- flavor/*/v*
workflow_dispatch:
jobs:
build:
name: Build (${{ matrix.debian }})
runs-on: [self-hosted, '${{ matrix.debian }}']
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
strategy:
matrix:
debian: [bullseye]
include:
- build_profile: 'generic'
build_cc: gcc
build_cflags: ''
steps:
- name: Clean Workspace
run: rm -rf *.deb *.ddeb *.build *.buildinfo *.changes
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: recursive
path: pve-edge-kernel
- name: Clean Repository
run: git -C pve-edge-kernel submodule foreach git clean -ffdx
- name: Build Kernel
run: |
cd pve-edge-kernel
debian/rules debian/control
if [ "$PVE_BUILD_PROFILE" != "generic" ]; then
debchange -l +$PVE_BUILD_PROFILE -D edge --force-distribution -U -M "Specialization for $PVE_BUILD_PROFILE"
fi
debuild --no-lintian -e PVE* -e CCACHE_DIR=/var/cache/ccache --prepend-path=/usr/lib/ccache --jobs=auto -b -uc -us
env:
PVE_BUILD_PROFILE: ${{ matrix.build_profile }}
PVE_KERNEL_CC: ${{ matrix.build_cc }}
PVE_KERNEL_CFLAGS: ${{ matrix.build_cflags }}
PVE_ZFS_CC: ${{ matrix.build_cc }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.debian }}-${{ matrix.build_profile }}
path: "*.deb"
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
needs: build
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Delete Debug Symbols
run: rm -f artifacts/*/*dbgsym*.deb
- name: Format Release Name
id: format_release
run: |
echo "release=$(scripts/version.sh)" >> $GITHUB_OUTPUT
changelog=$(dpkg-parsechangelog -c 1 -l debian/changelog)
echo "changelog<<EOF\n$changelog\nEOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
commit: ${{ github.sha }}
tag: v${{ steps.format_release.outputs.release }}
body: ${{ steps.format_release.outputs.changelog }}
token: ${{ secrets.PAT }}
artifacts: "artifacts/bullseye-generic/pve-headers-*.deb,artifacts/bullseye-generic/pve-kernel-*.deb,artifacts/bullseye-generic/linux-tools-*.deb"
- name: Release to CloudSmith
run: |
pip install --upgrade cloudsmith-cli
find artifacts/bullseye-generic \
-name '*.deb' \
-not -name "*dbgsym*" \
-exec cloudsmith push deb pve-edge/kernel/debian/bullseye {} --republish \;
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}

View file

@ -1,62 +0,0 @@
name: Kernel Update
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag of the Linux Kernel to update to'
required: true
version:
description: 'Custom version number'
required: false
release:
description: 'Custom release number'
required: false
jobs:
update:
name: Update
runs-on: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup System Dependencies
run: sudo apt update && sudo apt install devscripts
- name: Update Kernel
id: update
run: |
TAG=${{ github.event.inputs.tag }}
VERSION=${{ github.event.inputs.version }}
RELEASE=${{ github.event.inputs.release }}
VERSION_OPT=${VERSION:+-v ${VERSION}}
RELEASE_OPT=${RELEASE:+-r ${RELEASE}}
./scripts/update.sh -t ${{ github.event.inputs.tag }} $VERSION_OPT $RELEASE_OPT
echo "version=$(scripts/version.sh -L)" >> $GITHUB_OUTPUT
echo "full=$(scripts/version.sh)" >> $GITHUB_OUTPUT
changelog=$(dpkg-parsechangelog -c 1 -l debian/changelog)
echo "changelog<<EOF\n$changelog\nEOF" >> $GITHUB_OUTPUT
echo "branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT }} # Custom token needed to recursively trigger workflows
author: Fabian Mastenbroek <mail.fabianm@gmail.com>
commit-message: |
Add Linux ${{ steps.update.outputs.version }}
This change updates the kernel to Linux ${{ steps.update.outputs.version }}.
branch: staging/v${{ steps.update.outputs.full }}
branch-suffix: short-commit-hash
delete-branch: true
title: "Add Linux ${{ steps.update.outputs.version }}"
body: |
Automated pull request to update the kernel to Linux ${{ steps.update.outputs.version }}.
**Changelog:**
```
${{ steps.update.outputs.changelog }}
```
labels: |
release

View file

@ -1,47 +0,0 @@
name: Kernel Watch
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *' # Every day
jobs:
check:
name: Check for new Release
runs-on: [ubuntu-latest]
strategy:
matrix:
branch: ['v6.0.x']
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
submodules: recursive
- name: Setup System Dependencies
run: sudo apt install jq curl
- name: Check for Release
id: check
run: |
NEW=$(scripts/check.sh ${{ matrix.branch }})
if [[ -z $NEW ]]; then
echo "No new release found"
exit 0
fi
echo "Found new Linux kernel version $NEW"
STAGING=$(git ls-remote --heads origin "staging/v$NEW*")
if [[ $STAGING ]]; then
echo "Existing staging update found"
exit 0
fi
echo "No staging update found: triggering update"
echo "version=$NEW" >> $GITHUB_OUTPUT
- name: Trigger Update
if: ${{ steps.check.outputs.version }}
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Kernel Update
token: ${{ secrets.PAT }} # Custom token needed to recursively trigger workflows
inputs: '{ "tag": "v${{ steps.check.outputs.version }}" }'
ref: ${{ matrix.branch }}

3
debian/rules vendored
View file

@ -82,6 +82,9 @@ override_dh_auto_clean: debian/control
rm -f ${PVE_KERNEL_TEMPLATES} ${PVE_HEADER_TEMPLATES} rm -f ${PVE_KERNEL_TEMPLATES} ${PVE_HEADER_TEMPLATES}
rm -f debian/SOURCE debian/*.tmp .*_mark rm -f debian/SOURCE debian/*.tmp .*_mark
override_dh_strip_nondeterminism:
# Disables dh_strip_nondeterminism to speed up the debian package creation
## Kernel ## Kernel
PVE_KERNEL_TEMPLATES := $(patsubst debian/templates/pve-kernel.%.in, debian/${PVE_KERNEL_PKG}.%, $(wildcard debian/templates/pve-kernel.*.in)) PVE_KERNEL_TEMPLATES := $(patsubst debian/templates/pve-kernel.%.in, debian/${PVE_KERNEL_PKG}.%, $(wildcard debian/templates/pve-kernel.*.in))