GRM-20: feat: replace inline workflow scripts with tested Python modules

This commit is contained in:
Emil Simeonov
2026-06-19 15:34:36 +02:00
parent 3048d7ade7
commit 4d2ac8d449
9 changed files with 741 additions and 97 deletions
+6 -23
View File
@@ -10,31 +10,14 @@ jobs:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
python3 -m pip install build twine requests
- name: Build and publish release
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python3 -m venv .venv
.venv/bin/pip install build twine
# Build package
.venv/bin/python -m build
# Publish to PyPI (only if PYPI_TOKEN secret is configured)
if [ -n "${PYPI_TOKEN}" ]; then
.venv/bin/twine upload dist/* -u __token__ -p "${PYPI_TOKEN}"
echo "Published to PyPI."
else
echo "PYPI_TOKEN not set — skipping PyPI publish."
fi
# Create Gitea release
TAG="${{ github.ref_name }}"
curl -X POST \
"https://git.oblachno.oblachno.fyi/api/v1/repos/${{ github.repository }}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": \"Release ${TAG}\\n\\nSee CHANGELOG.md for details.\", \"draft\": false, \"prerelease\": false}"
echo "Gitea release ${TAG} created."
python3 scripts/publish.py \
"${{ github.ref_name }}" \
"${{ github.repository }}"