Skip to content

sync toml file with release version #6

sync toml file with release version

sync toml file with release version #6

name: Test Release Workflow on Release Branch
on:
push:
tags:
- 'v*'
branches:
- release # Change from main to release for testing
jobs:
validate-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Tag Format
run: |
TAG_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\-\.]+)?$'
TAG="${GITHUB_REF/refs\/tags\//}"
if [[ "$TAG" =~ $TAG_REGEX ]]; then
echo "Tag format is valid."
else
echo "::error::Tag $TAG does not match the 'vMAJOR.MINOR.PATCH' or 'vMAJOR.MINOR.PATCH-pre-release' format."
exit 1
shell: bash
build-and-package:
needs: validate-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Build the distribution
run: poetry build
dry-run-publish:
needs: build-and-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Dry run publish to PyPI
run: poetry publish --dry-run
# This step simulates the publishing process without making actual changes