Kumi
c33efd2e73
Updated the GitHub Actions workflow in `.forgejo/workflows/release.yml` to explicitly use `python3` instead of `python` for both version checking and virtual environment setup. This change ensures compatibility and clarity across environments where `python` might still point to Python 2.x, preventing potential conflicts and erasing ambiguity. The adjustment aligns with modern best practices, acknowledging the widespread transition to Python 3 and its tooling.
63 lines
1.3 KiB
YAML
63 lines
1.3 KiB
YAML
name: Python Package CI/CD
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup and Test
|
|
container:
|
|
image: node:20-bookworm
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt update
|
|
apt install -y python3 python3-venv
|
|
|
|
- name: Set up Python environment
|
|
run: |
|
|
python3 -V
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install -U pip
|
|
pip install .[all]
|
|
|
|
publish:
|
|
name: Publish to PyPI
|
|
container:
|
|
image: node:20-bookworm
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt update
|
|
apt install -y python3 python3-venv
|
|
|
|
- name: Set up Python environment
|
|
run: |
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
|
|
- name: Install publishing tools
|
|
run: |
|
|
pip install -U hatchling twine build
|
|
|
|
- name: Build the package
|
|
run: |
|
|
python -m build .
|
|
|
|
- name: Publish the package to PyPI
|
|
run: |
|
|
python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/*
|
|
env:
|
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|