Bump version to 3.0.1 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build zabbix-cli | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+**' | |
concurrency: | |
group: build-zabbix-cli-${{ github.head_ref }} | |
jobs: | |
build_pypi: | |
name: Build wheels and source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- uses: hynek/setup-cached-uv@v2 | |
# NOTE: need to install build in a venv because of immutable OS? | |
# Caused by: failed to create directory `/usr/local/lib/python3.10/dist-packages/pyproject_hooks-1.1.0.dist-info` | |
- name: Install build dependencies | |
run: | | |
uv venv | |
uv pip install --upgrade build | |
- name: Build source distribution | |
run: .venv/bin/python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pypi_artifacts | |
path: dist/* | |
if-no-files-found: error | |
build_pyinstaller: | |
name: Build pyinstaller binary | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest, macos-latest] | |
python-version: | |
- '3.12' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: hynek/setup-cached-uv@v2 | |
- name: Build binary with PyInstaller | |
run: | | |
uv pip install --system -U . pyinstaller | |
pyinstaller --onefile zabbix_cli/main.py --name zabbix-cli | |
- name: Rename binary | |
run: | | |
mv dist/zabbix-cli${{ contains(matrix.os, 'windows') && '.exe' || '' }} dist/zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }} | |
path: dist/zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }} | |
if-no-files-found: error | |
publish_pypi: | |
name: Publish PyPI release | |
needs: | |
- build_pypi | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: pypi_artifacts | |
path: dist | |
- name: Push build artifacts to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.8.14 | |
publish_github: | |
name: Publish GitHub release | |
needs: | |
- build_pypi | |
- build_pyinstaller | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download PyInstaller binaries | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: zabbix-cli-* | |
path: dist | |
merge-multiple: true | |
- name: Download wheel and source distributions | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: pypi_artifacts | |
path: dist | |
merge-multiple: true | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/* | |
body: | | |
Release notes for ${{ github.ref_name }} | |
draft: false | |
prerelease: false |