add cityagent #14
Workflow file for this run
This file contains hidden or 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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Upload Python Package | |
on: | |
push: | |
tags: [ 'v*.*.*' ] | |
release: | |
types: [ published ] | |
permissions: | |
contents: read | |
jobs: | |
deploy-linux: | |
name: Build wheels for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Create virtual environment and build wheels | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install build wheel | |
python -m build --wheel | |
- name: Upload Linux wheels as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-wheels | |
path: dist/*.whl | |
retention-days: 1 | |
deploy-macos: | |
name: Build wheels for macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Create virtual environment and build wheels | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install build wheel | |
python -m build --wheel | |
- name: Upload macOS wheels as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-wheels | |
path: dist/*.whl | |
retention-days: 1 | |
publish: | |
name: Publish wheels to PyPI | |
runs-on: ubuntu-latest | |
needs: [ deploy-linux, deploy-macos ] | |
permissions: | |
id-token: write # Required for PyPI trusted publishing | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Download Linux wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux-wheels | |
path: linux-wheels | |
- name: Download macOS wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos-wheels | |
path: macos-wheels | |
- name: Combine wheels into a single directory | |
run: | | |
mkdir -p dist | |
cp linux-wheels/*.whl dist/ | |
cp macos-wheels/*.whl dist/ | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Create virtual environment and publish to PyPI | |
run: | | |
uv venv | |
source .venv/bin/activate | |
uv pip install twine | |
python -m twine upload dist/*.whl |