Files
micro-agents/.gitea/workflows/publish.yml
2026-09-13 23:55:33 +02:00

65 lines
2.0 KiB
YAML

name: Test and publish
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install uv and Python
env:
UV_ARCHIVE_SHA256: 745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd
run: |
mkdir -p "$HOME/.local/bin"
curl -4 --fail --location --show-error --silent \
--retry 5 --retry-all-errors --connect-timeout 30 \
--output /tmp/uv.tar.gz \
https://github.com/astral-sh/uv/releases/download/0.12.13/uv-x86_64-unknown-linux-gnu.tar.gz
echo "$UV_ARCHIVE_SHA256 /tmp/uv.tar.gz" | sha256sum --check -
tar -xzf /tmp/uv.tar.gz --strip-components=1 -C "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/uv" python install 3.12
- name: Install workspace
run: uv sync --all-packages
- name: Run core tests
run: uv run python -m unittest discover -s tests
- name: Run tools tests
run: uv run python -m unittest discover -s packages/micro-agents-tools/tests
- name: Build distributions
run: |
uv build --no-sources
uv build --package micro-agents-tools --no-sources
- name: Verify registry credentials
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
run: |
if [ -z "$PACKAGE_TOKEN" ]; then
echo "::error::Repository secret PACKAGE_TOKEN is not configured"
exit 1
fi
curl --fail --silent --show-error \
--header "Authorization: token $PACKAGE_TOKEN" \
https://git.azimkin.dev/api/v1/user \
> /dev/null
- name: Publish to Gitea PyPI registry
env:
TWINE_USERNAME: Azimkin
TWINE_PASSWORD: ${{ secrets.PACKAGE_TOKEN }}
run: >-
uvx --from twine twine upload
--repository-url https://git.azimkin.dev/api/packages/Azimkin/pypi
dist/*