Skip to content

chore: sync develop with main post v0.2.3 release #38

chore: sync develop with main post v0.2.3 release

chore: sync develop with main post v0.2.3 release #38

Workflow file for this run

name: Dev Release
on:
push:
branches: [develop]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- run: pip install -e ".[dev]"
- run: ruff check src/ tests/
- run: ruff format --check src/ tests/
- run: mypy src/specsmith --ignore-missing-imports
- run: pytest tests/ -x -q
dev-build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install build tools
run: pip install build
- name: Set dev version
run: |
# Use pyproject.toml version as the base (no patch bump).
# pyproject.toml should always hold the NEXT release version (e.g. 0.2.3).
# Dev builds publish as 0.2.3.devN — PEP 440 pre-release of the upcoming release.
BASE_VERSION=$(grep 'version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
COMMIT_COUNT=$(git rev-list --count HEAD ^$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD~100) 2>/dev/null || echo 0)
DEV_VERSION="${BASE_VERSION}.dev${COMMIT_COUNT}"
echo "DEV_VERSION=${DEV_VERSION}" >> $GITHUB_ENV
# Patch pyproject.toml with dev version
sed -i "s/version = \"${BASE_VERSION}\"/version = \"${DEV_VERSION}\"/" pyproject.toml
echo "Building version: ${DEV_VERSION}"
- run: python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: dev-dist
path: dist/
pypi-dev-publish:
needs: dev-build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
continue-on-error: true
steps:
- uses: actions/download-artifact@v8
with:
name: dev-dist
path: dist/
- name: Publish dev release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
docs-build:
needs: dev-build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Trigger ReadTheDocs build for develop
run: |
curl -s -X POST \
-H "Authorization: Token ${{ secrets.RTD_TOKEN }}" \
"https://readthedocs.org/api/v3/projects/specsmith/versions/develop/builds/"