Skip to content

Small improvements, bump version #7

Small improvements, bump version

Small improvements, bump version #7

Workflow file for this run

name: Tag Version
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry==1.8.3
poetry install
- name: Run tests
run: poetry run pytest
tag-version:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install toml
- name: Get current version
id: get_version
run: |
./version.py > tmp.txt
echo "CURRENT_VERSION=$(cat tmp.txt)" >> $GITHUB_ENV
- name: Get latest tag
id: get_latest_tag
uses: actions-ecosystem/action-get-latest-tag@v1
- name: Check for version change
id: check_version
run: |
PREVIOUS_VERSION=${{ steps.get_latest_tag.outputs.tag }}
echo "Previous version: $PREVIOUS_VERSION"
echo "Current version: $CURRENT_VERSION"
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
echo "TAG=$CURRENT_VERSION" >> $GITHUB_ENV
else
echo "No new version detected."
fi
- name: Push tag
if: env.TAG
uses: actions-ecosystem/action-push-tag@v1
with:
tag: ${{ env.TAG }}