From 8f0ef8fa756794ccd951aa5e7b5ee90cd0cfc982 Mon Sep 17 00:00:00 2001 From: Justin Guese Date: Thu, 18 Sep 2025 17:13:21 +0200 Subject: [PATCH 1/2] Refactor GitHub Actions workflow for Poetry publish: update Python version to 3.11 and set version from tag name --- .github/workflows/main.yml | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18654b7b..e846670c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,29 +2,27 @@ name: Poetry publish on: push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + tags: + - 'v*' jobs: buildPush: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - name: Install Poetry - run: | - python -m pip install --upgrade pip - pip install poetry - # use the hardcoded version number for now. if this is merged to the main repo, you can uncomment these lines to automatically tag the version number with the github run number - # e.g. poetry version 0.1.${{ github.run_number }} - - name: Set Version number - run: | - poetry version 1.3.0 - - name: Build and Publish to PyPI - run: | - poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} - poetry publish --build + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install Poetry + run: | + python -m pip install --upgrade pip + pip install poetry + # Set Poetry version from tag name (strip leading 'v') + - name: Set Version number from tag + run: | + poetry version $(echo ${{ github.ref_name }} | sed 's/^v//') + - name: Build and Publish to PyPI + run: | + poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} + poetry publish --build From 9bf951086c219333e0217843817c1b4cb54d1a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20G=C3=BCse?= Date: Thu, 18 Sep 2025 17:15:54 +0200 Subject: [PATCH 2/2] use checkout action 4 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e846670c..3cc38f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: buildPush: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: