feat: build and upload deb package in release workflow
This commit is contained in:
@@ -83,7 +83,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Derive version from tag
|
- name: Derive version from tag
|
||||||
id: version
|
id: version
|
||||||
run: echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
run: |
|
||||||
|
tag="${GITHUB_REF_NAME}"
|
||||||
|
deb_version="${tag#v}"
|
||||||
|
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "deb_version=${deb_version}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Build standalone binary with Nuitka
|
- name: Build standalone binary with Nuitka
|
||||||
run: |
|
run: |
|
||||||
@@ -100,6 +104,33 @@ jobs:
|
|||||||
- name: Smoke-test the binary
|
- name: Smoke-test the binary
|
||||||
run: dist/tai --help
|
run: dist/tai --help
|
||||||
|
|
||||||
|
- name: Build .deb package
|
||||||
|
run: |
|
||||||
|
pkg_root="pkgroot"
|
||||||
|
pkg_name="tai"
|
||||||
|
deb_version="${{ steps.version.outputs.deb_version }}"
|
||||||
|
arch="amd64"
|
||||||
|
out_dir="dist"
|
||||||
|
deb_dir="${pkg_root}/${pkg_name}_${deb_version}_${arch}"
|
||||||
|
|
||||||
|
rm -rf "${pkg_root}"
|
||||||
|
mkdir -p "${deb_dir}/DEBIAN"
|
||||||
|
mkdir -p "${deb_dir}/usr/bin"
|
||||||
|
|
||||||
|
install -m 0755 dist/tai "${deb_dir}/usr/bin/tai"
|
||||||
|
|
||||||
|
cat > "${deb_dir}/DEBIAN/control" <<EOF
|
||||||
|
Package: ${pkg_name}
|
||||||
|
Version: ${deb_version}
|
||||||
|
Section: admin
|
||||||
|
Priority: optional
|
||||||
|
Architecture: ${arch}
|
||||||
|
Maintainer: tai maintainers <noreply@example.com>
|
||||||
|
Description: tai Linux troubleshooting assistant
|
||||||
|
EOF
|
||||||
|
|
||||||
|
dpkg-deb --build "${deb_dir}" "${out_dir}/${pkg_name}_${deb_version}_${arch}.deb"
|
||||||
|
|
||||||
- name: Upload binary artifact
|
- name: Upload binary artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -107,3 +138,11 @@ jobs:
|
|||||||
path: dist/tai
|
path: dist/tai
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
||||||
|
- name: Upload deb artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: tai-deb-amd64-${{ steps.version.outputs.tag }}
|
||||||
|
path: dist/tai_${{ steps.version.outputs.deb_version }}_amd64.deb
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 90
|
||||||
|
|||||||
Reference in New Issue
Block a user