Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 48 additions & 3 deletions .github/workflows/swc-aeon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
push:
branches: ['**']
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
release:
types: [published]
workflow_dispatch: # allows running manually from GitHub Actions

jobs:
build_env_run_tests: # runs codebase checks and tests using pyproject.toml
build: # build package and run codebase checks and tests using pyproject.toml
strategy:
fail-fast: false
matrix:
Expand All @@ -27,6 +27,7 @@ jobs:
os: ubuntu-latest
python-version: "3.13"
codecov: --cov-report=xml:tests/test_coverage/test_coverage_report.xml
collect-packages: true
- platform:
name: Windows
os: windows-latest
Expand Down Expand Up @@ -60,6 +61,7 @@ jobs:
run: uv run pyright --level error --project ./pyproject.toml .

- name: Build
id: build
run: uv build

# -------------------------------------------------------- Test
Expand All @@ -76,3 +78,46 @@ jobs:
files: test_coverage_report.xml
fail_ci_if_error: true
verbose: true

# -------------------------------------------------------- Collect artifacts
- name: Collect Python packages
uses: actions/upload-artifact@v4
if: matrix.collect-packages && steps.build.outcome == 'success' && always()
with:
name: Packages
if-no-files-found: error
path: dist/

# -------------------------------------------------------- Upload release assets
- name: Upload release assets
if: github.event_name == 'release'
run: gh release upload --repo ${{ github.repository }} ${{ github.event.release.tag_name }} dist/* --clobber
env:
GH_TOKEN: ${{ github.token }}

publish-pypi:
name: Publish packages to PyPI
runs-on: ubuntu-latest
environment: public-release
needs: build
permissions:
# Needed to attach files to releases
contents: write
if: github.event_name == 'release'
steps:
# -------------------------------------------------------- Set up tools
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"

# -------------------------------------------------------- Download built packages
- name: Download built packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist/

# -------------------------------------------------------- Push to PyPI
- name: Push to PyPI
run: uv publish dist/* --token ${{ secrets.PYPI_API_TOKEN }}