e33e999d2c
This change adds a workflow step to release the Debian packages to CloudSmith, which will host Debian packages for Open Source projects for free.
92 lines
3.1 KiB
YAML
92 lines
3.1 KiB
YAML
name: Kernel Release
|
|
|
|
on:
|
|
pull_request:
|
|
types: [closed]
|
|
branches:
|
|
- v*
|
|
- flavor/*/v*
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: [self-hosted, build]
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
|
|
strategy:
|
|
matrix:
|
|
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@v2
|
|
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 -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@v2-preview
|
|
with:
|
|
name: debs-${{ 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@v2
|
|
with:
|
|
submodules: recursive
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
path: artifacts
|
|
- name: Delete Debug Symbols
|
|
run: rm -f artifacts/*/*dbgsym*.deb
|
|
- name: Format Release Name
|
|
id: format_release
|
|
run: |
|
|
release=$(scripts/version.sh)
|
|
echo "::set-output name=release::$release"
|
|
changelog=$(dpkg-parsechangelog -c 1 -l debian/changelog)
|
|
changelog="${changelog//'%'/'%25'}"
|
|
changelog="${changelog//$'\n'/'%0A'}"
|
|
changelog="${changelog//$'\r'/'%0D'}"
|
|
echo "::set-output name=changelog::$changelog"
|
|
- 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/debs-generic/pve-headers-*.deb,artifacts/debs-generic/linux-tools-*.deb,artifacts/debs-*/pve-kernel-*.deb"
|
|
- name: Release to CloudSmith
|
|
run: |
|
|
pip install --upgrade cloudsmith-cli
|
|
find artifacts/debs-generic \
|
|
-name '*.deb' \
|
|
-not -name "*dbgsym*" \
|
|
-exec cloudsmith push deb pve-edge/kernel/any-distro/any-version {} --republish \;
|
|
env:
|
|
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|