Skip to content

Bump sphinx from 6.2.1 to 8.1.3 #69

Bump sphinx from 6.2.1 to 8.1.3

Bump sphinx from 6.2.1 to 8.1.3 #69

Workflow file for this run

name: Publish Package (PyPI)
on:
pull_request:
branches:
- main
jobs:
build_and_publish:
name: "Build and Publish PyPI package - TEST"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/oakutils
permissions:
id-token: write
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build toml
- name: Update version in pyproject.toml
run: |
python3 << END
import toml
import os
from datetime import datetime
# Read the current pyproject.toml
with open('pyproject.toml', 'r') as f:
config = toml.load(f)
# Get the current version
current_version = config['project']['version']
# Create a unique version using GitHub run number and current date
run_number = os.environ['GITHUB_RUN_NUMBER']
current_date = datetime.now().strftime("%Y%m%d")
new_version = f"{current_version}.dev{current_date}{run_number}"
# Update the version in the config
config['project']['version'] = new_version
# Write the updated config back to pyproject.toml
with open('pyproject.toml', 'w') as f:
toml.dump(config, f)
print(f"Updated version to {new_version}")
END
- name: Build oakutils
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}