Publish release for release tags

This commit is contained in:
Fabian Mastenbroek 2020-04-28 23:01:54 +02:00
parent af66b6b47f
commit 39cda7683d
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
2 changed files with 31 additions and 2 deletions

View file

@ -17,9 +17,30 @@ jobs:
submodules: recursive
- name: Build Kernel
run: make
- name: Read Build Information
id: read_build_info
run: |
echo "::set-output name=release::$(sed '1q;d' release.txt)"
echo "::set-output name=dst::$(sed '1q;d' artifacts.txt)"
echo "::set-output name=hdr::$(sed '2q;d' artifacts.txt)"
echo "::set-output name=tools::$(sed '3q;d' artifacts.txt)"
CHANGELOG=$(dpkg-parsechangelog -c 1 -l debian/changelog)
- name: Upload Artifacts
uses: actions/upload-artifact@v2-preview
with:
name: debs
path: "*.deb"
- name: Create Release
if: startsWith(github.ref, 'refs/tags/release')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
run: |
set -x
assets=()
for asset in ./*.deb; do
assets + =("-a" "$asset")
done
tag_name=${GITHUB_REF#"refs/tags/"}
release_name="${{ steps.read_build_info.outputs.release }}"
changelog=$(dpkg-parsechangelog -c 1 -l debian/changelog)
hub release create "${assets[@]}" -m "$release_name" -m "$changelog" "$tag_name"

View file

@ -63,14 +63,22 @@ LINUX_TOOLS_DEB=linux-tools-$(KERNEL_MAJMIN)_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
DEBS=${DST_DEB} ${HDR_DEB} ${LINUX_TOOLS_DEB}
all: deb release.txt
all: deb release.txt artifacts.txt
deb: ${DEBS}
release.txt:
echo "${KVNAME}" > release.txt
echo "${KERNEL_VER}" >> release.txt
echo "${PKGREL}" >> release.txt
echo "${ARCH}" >> release.txt
echo "${PVE_BUILD_FLAVOR}" >> release.txt
echo "${PVE_BUILD_TYPE}" >> release.txt
artifacts.txt:
echo "${DST_DEB}" > artifacts.txt
echo "${HDR_DEB}" >> artifacts.txt
echo "${LINUX_TOOLS_DEB}" >> artifacts.txt
${LINUX_TOOLS_DEB} ${HDR_DEB}: ${DST_DEB}
${DST_DEB}: ${BUILD_DIR}.prepared
cd ${BUILD_DIR}; dpkg-buildpackage --jobs=auto -b -uc -us