Compare commits
8 Commits
0.1.0
...
feature/ph
| Author | SHA1 | Date | |
|---|---|---|---|
| d092b508c3 | |||
| 7e1cac8bd1 | |||
| 5fea8fe096 | |||
| 05adbf7cc9 | |||
| 69d2bdd661 | |||
| f88048762e | |||
| 60f42c7754 | |||
| 33dff26d2b |
@@ -59,14 +59,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Ensure Python and pip are available
|
- name: Ensure Python and pip are available
|
||||||
run: |
|
run: |
|
||||||
if command -v python3 >/dev/null 2>&1 && python3 -m pip --version >/dev/null 2>&1; then
|
|
||||||
python3 --version
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y python3 python3-pip python3-venv
|
apt-get install -y python3.12 python3.12-venv python3-pip || \
|
||||||
|
apt-get install -y python3 python3-pip python3-venv
|
||||||
elif command -v dnf >/dev/null 2>&1; then
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
dnf install -y python3 python3-pip
|
dnf install -y python3 python3-pip
|
||||||
elif command -v yum >/dev/null 2>&1; then
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
@@ -76,11 +72,11 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python3 --version
|
python3.12 --version || python3 --version
|
||||||
|
|
||||||
- name: Install package and dev dependencies
|
- name: Install package and dev dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m venv .venv
|
python3.12 -m venv .venv 2>/dev/null || python3 -m venv .venv
|
||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -e .[dev]
|
python -m pip install -e .[dev]
|
||||||
|
|||||||
@@ -59,32 +59,35 @@ jobs:
|
|||||||
|
|
||||||
- name: Ensure Python and build dependencies are available
|
- name: Ensure Python and build dependencies are available
|
||||||
run: |
|
run: |
|
||||||
if ! command -v python3 >/dev/null 2>&1; then
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
apt-get update
|
||||||
apt-get update
|
apt-get install -y python3.12 python3.12-venv python3-pip patchelf ccache || \
|
||||||
apt-get install -y python3 python3-pip python3-venv patchelf ccache
|
apt-get install -y python3 python3-pip python3-venv patchelf ccache
|
||||||
elif command -v dnf >/dev/null 2>&1; then
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
dnf install -y python3 python3-pip patchelf ccache
|
dnf install -y python3 python3-pip python3-devel patchelf ccache
|
||||||
fi
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
|
yum install -y python3 python3-pip python3-devel patchelf ccache
|
||||||
|
else
|
||||||
|
echo "No supported package manager found to install Python/build deps."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# patchelf is required by Nuitka for standalone Linux binaries
|
python3.12 --version || python3 --version
|
||||||
command -v patchelf >/dev/null 2>&1 || {
|
|
||||||
apt-get update && apt-get install -y patchelf
|
|
||||||
}
|
|
||||||
|
|
||||||
python3 --version
|
|
||||||
|
|
||||||
- name: Set up venv and install package + build deps
|
- name: Set up venv and install package + build deps
|
||||||
run: |
|
run: |
|
||||||
python3 -m venv .venv
|
python3.12 -m venv .venv 2>/dev/null || python3 -m venv .venv
|
||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -e ".[build]"
|
python -m pip install -e ".[build]"
|
||||||
|
|
||||||
- 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}"
|
||||||
|
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: |
|
||||||
@@ -101,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:
|
||||||
@@ -108,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