2020-04-29 10:08:37 +00:00
|
|
|
name: Kernel Release
|
|
|
|
|
|
|
|
on:
|
2021-04-19 19:14:58 +00:00
|
|
|
pull_request:
|
|
|
|
types: [closed]
|
2021-05-02 13:27:07 +00:00
|
|
|
branches:
|
2020-09-18 10:54:40 +00:00
|
|
|
- v*
|
|
|
|
- flavor/*/v*
|
2021-04-19 19:14:58 +00:00
|
|
|
workflow_dispatch:
|
2020-04-29 10:08:37 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-06-29 12:44:56 +00:00
|
|
|
build:
|
|
|
|
name: Build (${{ matrix.debian }})
|
|
|
|
runs-on: [self-hosted, '${{ matrix.debian }}']
|
2021-04-19 19:14:58 +00:00
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
|
2020-04-29 10:08:37 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-26 10:07:55 +00:00
|
|
|
debian: [bullseye]
|
2020-04-29 10:08:37 +00:00
|
|
|
include:
|
2021-04-18 17:55:44 +00:00
|
|
|
- build_profile: 'generic'
|
2021-04-19 15:55:01 +00:00
|
|
|
build_cc: gcc
|
2020-08-09 10:12:59 +00:00
|
|
|
build_cflags: ''
|
2020-04-29 10:08:37 +00:00
|
|
|
steps:
|
2021-04-18 17:55:44 +00:00
|
|
|
- name: Clean Workspace
|
|
|
|
run: rm -rf *.deb *.ddeb *.build *.buildinfo *.changes
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Checkout Sources
|
2022-10-26 11:24:54 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-04-29 10:08:37 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-04-18 17:55:44 +00:00
|
|
|
path: pve-edge-kernel
|
|
|
|
- name: Clean Repository
|
|
|
|
run: git -C pve-edge-kernel submodule foreach git clean -ffdx
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Build Kernel
|
|
|
|
run: |
|
2021-04-18 17:55:44 +00:00
|
|
|
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
|
2021-06-29 13:13:55 +00:00
|
|
|
debuild --no-lintian -e PVE* -e CCACHE_DIR=/var/cache/ccache --prepend-path=/usr/lib/ccache --jobs=auto -b -uc -us
|
2021-04-18 17:55:44 +00:00
|
|
|
env:
|
2021-04-19 19:14:58 +00:00
|
|
|
PVE_BUILD_PROFILE: ${{ matrix.build_profile }}
|
2021-04-18 17:55:44 +00:00
|
|
|
PVE_KERNEL_CC: ${{ matrix.build_cc }}
|
|
|
|
PVE_KERNEL_CFLAGS: ${{ matrix.build_cflags }}
|
|
|
|
PVE_ZFS_CC: ${{ matrix.build_cc }}
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Upload Artifacts
|
2022-10-26 11:24:54 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-29 10:08:37 +00:00
|
|
|
with:
|
2021-06-29 12:44:56 +00:00
|
|
|
name: ${{ matrix.debian }}-${{ matrix.build_profile }}
|
2020-04-29 10:08:37 +00:00
|
|
|
path: "*.deb"
|
2021-06-29 12:44:56 +00:00
|
|
|
publish:
|
2020-09-16 20:24:33 +00:00
|
|
|
name: Publish
|
2021-06-13 13:25:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-19 19:14:58 +00:00
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
|
2020-04-29 10:08:37 +00:00
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Checkout Sources
|
2022-10-26 11:24:54 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Download Artifacts
|
2022-10-26 11:24:54 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2020-04-29 10:08:37 +00:00
|
|
|
with:
|
|
|
|
path: artifacts
|
2021-04-19 19:14:58 +00:00
|
|
|
- name: Delete Debug Symbols
|
|
|
|
run: rm -f artifacts/*/*dbgsym*.deb
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Format Release Name
|
|
|
|
id: format_release
|
|
|
|
run: |
|
2022-12-14 00:10:34 +00:00
|
|
|
echo "release=$(scripts/version.sh)" >> $GITHUB_OUTPUT
|
2020-04-29 10:08:37 +00:00
|
|
|
changelog=$(dpkg-parsechangelog -c 1 -l debian/changelog)
|
|
|
|
changelog="${changelog//'%'/'%25'}"
|
|
|
|
changelog="${changelog//$'\n'/'%0A'}"
|
|
|
|
changelog="${changelog//$'\r'/'%0D'}"
|
2022-12-14 00:10:34 +00:00
|
|
|
echo "changelog=$changelog" >> $GITHUB_OUTPUT
|
2020-04-29 10:08:37 +00:00
|
|
|
- name: Create Release
|
2021-04-19 19:14:58 +00:00
|
|
|
uses: ncipollo/release-action@v1
|
2020-04-29 10:08:37 +00:00
|
|
|
with:
|
2021-04-19 19:14:58 +00:00
|
|
|
commit: ${{ github.sha }}
|
|
|
|
tag: v${{ steps.format_release.outputs.release }}
|
2020-04-29 10:08:37 +00:00
|
|
|
body: ${{ steps.format_release.outputs.changelog }}
|
2021-04-19 19:14:58 +00:00
|
|
|
token: ${{ secrets.PAT }}
|
2022-10-26 10:07:55 +00:00
|
|
|
artifacts: "artifacts/bullseye-generic/pve-headers-*.deb,artifacts/bullseye-generic/pve-kernel-*.deb,artifacts/bullseye-generic/linux-tools-*.deb"
|
2021-06-13 13:25:50 +00:00
|
|
|
- name: Release to CloudSmith
|
|
|
|
run: |
|
|
|
|
pip install --upgrade cloudsmith-cli
|
2021-06-29 12:44:56 +00:00
|
|
|
find artifacts/bullseye-generic \
|
|
|
|
-name '*.deb' \
|
|
|
|
-not -name "*dbgsym*" \
|
|
|
|
-exec cloudsmith push deb pve-edge/kernel/debian/bullseye {} --republish \;
|
2021-06-13 13:25:50 +00:00
|
|
|
env:
|
|
|
|
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|