Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Package

permissions:
contents: read

on:
workflow_call:
inputs:
python-version:
required: false
type: string
default: "3.10"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: 🐍 Install uv and set Python version ${{ inputs.python-version }}
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
python-version: ${{ inputs.python-version }}
activate-environment: true

- name: 🏗️ Build source and wheel distributions
run: |
uv pip install -r pyproject.toml --group build
uv build
uv run twine check --strict dist/*

- name: 📤 Upload distribution artifacts
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/
40 changes: 21 additions & 19 deletions .github/workflows/publish-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ name: Publish Trackers Pre-Releases to PyPI
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+.a[0-9]"
- "[0-9]+.[0-9]+.[0-9]+.b[0-9]"
- "[0-9]+.[0-9]+.[0-9]+.rc[0-9]"
- "[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]"
- "[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]"
- "[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]"
workflow_dispatch:
pull_request:
branches: [main, develop]
paths:
- '.github/workflows/build-package.yml'
- '.github/workflows/publish-pre-release.yml'

permissions: {} # Explicitly remove all permissions by default

jobs:
build:
permissions:
contents: read
uses: ./.github/workflows/build-package.yml

publish-pre-release:
name: Publish Pre-release Package
needs: build
runs-on: ubuntu-latest
environment:
name: test
Expand All @@ -21,26 +32,17 @@ jobs:
permissions:
id-token: write # Required for PyPI publishing
contents: read # Required for checkout
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
- name: 📥 Download distribution artifacts
uses: actions/download-artifact@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: true

- name: 🏗️ Build source and wheel distributions
run: |
uv pip install -r pyproject.toml --group build
uv build
uv run twine check --strict dist/*
name: dist
path: dist/
- name: List distribution artifacts
run: ls -lh dist/

- name: 🚀 Publish to PyPi
if: github.event_name != 'pull_request'
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
attestations: true
36 changes: 19 additions & 17 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ name: Publish Trackers Releases to PyPI
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]"
- "[0-9]+.[0-9]+[0-9]+.[0-9]"
workflow_dispatch:
pull_request:
branches: [main, develop]
paths:
- '.github/workflows/build-package.yml'
- '.github/workflows/publish-release.yml'

permissions: {} # Explicitly remove all permissions by default

jobs:
build:
permissions:
contents: read
uses: ./.github/workflows/build-package.yml

publish-release:
name: Publish Release Package
needs: build
runs-on: ubuntu-latest
environment:
name: release
Expand All @@ -19,26 +30,17 @@ jobs:
permissions:
id-token: write # Required for PyPI publishing
contents: read # Required for checkout
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
- name: 📥 Download distribution artifacts
uses: actions/download-artifact@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: true

- name: 🏗️ Build source and wheel distributions
run: |
uv pip install -r pyproject.toml --group build
uv build
uv run twine check --strict dist/*
name: dist
path: dist/
- name: List distribution artifacts
run: ls -lh dist/

- name: 🚀 Publish to PyPi
if: github.event_name != 'pull_request'
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
attestations: true