From cb20b06d49fd1ce6d99caa8d4a2b8c9e5effa199 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 6 Oct 2024 17:31:03 -0400 Subject: [PATCH] forgejo: enable build.yml --- .forgejo/workflows/release-build.yml | 55 ++++++++++++++++++ .github/FUNDING.yml | 1 - .github/workflows/release.yml | 87 ---------------------------- .github/workflows/update.yml | 62 -------------------- .github/workflows/watch.yml | 47 --------------- debian/rules | 3 + 6 files changed, 58 insertions(+), 197 deletions(-) create mode 100644 .forgejo/workflows/release-build.yml delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/update.yml delete mode 100644 .github/workflows/watch.yml diff --git a/.forgejo/workflows/release-build.yml b/.forgejo/workflows/release-build.yml new file mode 100644 index 0000000..53dc799 --- /dev/null +++ b/.forgejo/workflows/release-build.yml @@ -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 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 5353469..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: https://www.buymeacoffee.com/fabianishere diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 652eb6e..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -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<> $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 }} diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index 596fe9e..0000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -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<> $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 - 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 diff --git a/.github/workflows/watch.yml b/.github/workflows/watch.yml deleted file mode 100644 index ef8d29b..0000000 --- a/.github/workflows/watch.yml +++ /dev/null @@ -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 }} - diff --git a/debian/rules b/debian/rules index 98082a0..04e4644 100755 --- a/debian/rules +++ b/debian/rules @@ -82,6 +82,9 @@ override_dh_auto_clean: debian/control rm -f ${PVE_KERNEL_TEMPLATES} ${PVE_HEADER_TEMPLATES} rm -f debian/SOURCE debian/*.tmp .*_mark +override_dh_strip_nondeterminism: + # Disables dh_strip_nondeterminism to speed up the debian package creation + ## Kernel PVE_KERNEL_TEMPLATES := $(patsubst debian/templates/pve-kernel.%.in, debian/${PVE_KERNEL_PKG}.%, $(wildcard debian/templates/pve-kernel.*.in))