Files
Jyotisha/.gitea/workflows/publish-pypi.yml
T
linmeng f4e35974c6
Deploy staging to test server / deploy (push) Failing after 14m49s
Revert "merge: sync GitHub staging to Gitea"
This reverts commit a55c69115d, reversing
changes made to 02c9c9f3d6.
2026-07-30 14:38:17 +08:00

44 lines
1.3 KiB
YAML

name: Publish to PyPI (manual only)
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: xiaoxin
env:
GITEA_SHA: ${{ gitea.sha }}
steps:
- name: Checkout current Gitea revision
run: |
set -euo pipefail
git init .
git remote remove origin 2>/dev/null || true
git remote add origin https://git.copse.top/root/Jyotisha.git
git fetch --no-tags origin "$GITEA_SHA"
git checkout --detach --force "$GITEA_SHA"
- name: Verify runner toolchain
run: |
set -euo pipefail
python3 --version
node --version
npm --version
docker version
- name: Build and check package
run: |
set -euo pipefail
python3 -m venv .venv
export PATH="$PWD/.venv/bin:$PATH"
python -m pip install --upgrade pip
python -m pip install build twine
python -m build
python -m twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
set -euo pipefail
export PATH="$PWD/.venv/bin:$PATH"
python -m twine upload --skip-existing dist/*