Publish release for release tags
This commit is contained in:
parent
af66b6b47f
commit
39cda7683d
2 changed files with 31 additions and 2 deletions
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
|
@ -17,9 +17,30 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Build Kernel
|
- name: Build Kernel
|
||||||
run: make
|
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
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v2-preview
|
uses: actions/upload-artifact@v2-preview
|
||||||
with:
|
with:
|
||||||
name: debs
|
name: debs
|
||||||
path: "*.deb"
|
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"
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -63,14 +63,22 @@ LINUX_TOOLS_DEB=linux-tools-$(KERNEL_MAJMIN)_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
||||||
|
|
||||||
DEBS=${DST_DEB} ${HDR_DEB} ${LINUX_TOOLS_DEB}
|
DEBS=${DST_DEB} ${HDR_DEB} ${LINUX_TOOLS_DEB}
|
||||||
|
|
||||||
all: deb release.txt
|
all: deb release.txt artifacts.txt
|
||||||
deb: ${DEBS}
|
deb: ${DEBS}
|
||||||
|
|
||||||
release.txt:
|
release.txt:
|
||||||
echo "${KVNAME}" > 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_FLAVOR}" >> release.txt
|
||||||
echo "${PVE_BUILD_TYPE}" >> 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}
|
${LINUX_TOOLS_DEB} ${HDR_DEB}: ${DST_DEB}
|
||||||
${DST_DEB}: ${BUILD_DIR}.prepared
|
${DST_DEB}: ${BUILD_DIR}.prepared
|
||||||
cd ${BUILD_DIR}; dpkg-buildpackage --jobs=auto -b -uc -us
|
cd ${BUILD_DIR}; dpkg-buildpackage --jobs=auto -b -uc -us
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue