Skip to content

ci: updated github actions to publish docs #26

ci: updated github actions to publish docs

ci: updated github actions to publish docs #26

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: stage & preview workflow
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master, main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish_dev_build:
name: Upload release to Test PyPI
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/p/stringpod
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
strategy:
matrix:
python-versions: [3.12]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for proper versioning
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry tox tox-gh-actions
- name: test with tox
run: tox
- name: Set dev version and build
run: |
# Clean any existing builds
rm -rf dist/
# Get current timestamp (using UTC)
TIMESTAMP=$(date -u +%Y%m%d%H%M%S)
# Update version with dev suffix (PEP 440 compliant)
# Format: 0.1.0.dev20240221120201
poetry version $(poetry version --short).dev$TIMESTAMP
echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV
# Build with new version
poetry build
- name: publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true # Skip if version already exists
verbose: true