Add tests for recent message part bugs #60
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
tags: ["v*"] | |
jobs: | |
build-and-publish: | |
name: Build and Publish | |
environment: protected | |
permissions: | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
with: | |
python-version: "3.9" | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@e78f54a89cb052fff327414dd9ff010b5d2b4dbd | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- name: Install package | |
run: poetry install | |
- name: Validate version | |
run: | | |
TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
POETRY_VERSION=$(poetry version -s) | |
INIT_VERSION=$(poetry run python -c "import rigging; print(rigging.__version__)") | |
if ! [[ $TAG_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "Invalid tag format: $TAG_VERSION. Must be vX.X.X" | |
exit 1 | |
fi | |
if [ "$POETRY_VERSION" != "$INIT_VERSION" ]; then | |
echo "Version mismatch: pyproject.toml ($POETRY_VERSION) != __init__.py ($INIT_VERSION)" | |
exit 1 | |
fi | |
if [ "$TAG_VERSION" != "$POETRY_VERSION" ]; then | |
echo "Tag ($TAG_VERSION) doesn't match pyproject.toml ($POETRY_VERSION)" | |
exit 1 | |
fi | |
- name: Build package | |
run: poetry build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc |