From b1451d713828b0df14dcf21fa2e01ab462e8ed0f Mon Sep 17 00:00:00 2001 From: Fabian Franz Steiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:13:52 +0000 Subject: [PATCH 1/3] Update GitHub Actions workflows to support Python 3.12 and 3.13, and add check for Python file changes before release --- .devcontainer/devcontainer.json | 7 ++++++- .github/workflows/python-package.yml | 2 +- .github/workflows/release.yml | 21 ++++++++++++++++++++- .vscode/extensions.json | 3 ++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b68620b..3a67047 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,12 @@ "vscode": { "extensions": [ "elagil.pre-commit-helper", - "ms-python.python" + "ms-python.python", + "github.vscode-github-actions", + "vscode-icons-team.vscode-icons", + "yzhang.markdown-all-in-one", + "bierner.markdown-checkbox", + "bierner.markdown-preview-github-styles" ] } } diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 118783d..ed8be07 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5425f99..9c04827 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,8 @@ permissions: jobs: create-release: runs-on: ubuntu-latest + outputs: + python_changed: ${{ steps.check-python-changes.outputs.python_changed }} steps: - name: Checkout repository @@ -35,6 +37,21 @@ jobs: command: query version: unreleased + - name: Check for Python file changes + id: check-python-changes + run: | + git fetch origin main + # Compare current commit to previous one on this branch + CHANGED_FILES=$(git diff --name-only HEAD^ HEAD) + echo "Changed files: $CHANGED_FILES" + + # Check if any Python file was changed + if echo "$CHANGED_FILES" | grep -E '\.py$'; then + echo "python_changed=true" >> $GITHUB_ENV + else + echo "python_changed=false" >> $GITHUB_ENV + fi + - name: Set Version Bump Type from GitVersion id: version-bump if: github.ref == 'refs/heads/main' @@ -117,6 +134,7 @@ jobs: git push origin ${{ steps.gitversion.outputs.semVer }} - name: Create GitHub Release + if: env.python_changed == 'true' uses: softprops/action-gh-release@v1 with: tag_name: v${{ steps.gitversion.outputs.semVer }} @@ -128,6 +146,7 @@ jobs: dist/*.whl dist/*.tar.gz - name: Upload distributions + if: env.python_changed == 'true' uses: actions/upload-artifact@v4 with: name: release-dists @@ -136,7 +155,7 @@ jobs: runs-on: ubuntu-latest needs: - create-release - if: github.ref == 'refs/heads/main' # Ensures it only runs for the main branch + if: github.ref == 'refs/heads/main' && needs.create-release.outputs.python_changed == 'true' # Ensures it only runs for the main branch and if Python files were changed permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7494b87..e1f21b2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,7 @@ { "recommendations": [ "elagil.pre-commit-helper", - "ms-python.python" + "ms-python.python", + "github.vscode-github-actions" ] } \ No newline at end of file From f81fce5e0915568d7c5f688abd0f8586119ce49f Mon Sep 17 00:00:00 2001 From: Fabian Franz Steiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:24:24 +0000 Subject: [PATCH 2/3] Update CHANGELOG for unreleased changes, including new workflow steps for Python file detection and support for Python 3.12 and 3.13 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db13cbe..e1db50a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added a step to detect if any Python files were changed (`check-python-changes`) in the release workflow. +- The `release` and `publish to PyPI` steps now only run if Python files were changed. +- The workflow now supports Python 3.12 and Python 3.13 in addition to 3.9–3.11. + +- In the Dev Container: + - Added GitHub Actions support extension. + - Added VSCode Icons extension. + - Added Markdown All in One extension. + - Added Markdown Checkbox extension. + - Added Markdown Preview GitHub Styles extension. + +- In the VSCode workspace recommendations: + - Added GitHub Actions extension to `.vscode/extensions.json`. + +### Changed + +- Improved release workflow logic to skip release and publish steps if no Python files were changed. + ## [0.7.0] - 2025-06-13 ### Added From a7b9b6ca40e1b8691b2c0df7522102b0a77d12cb Mon Sep 17 00:00:00 2001 From: fasteiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:24:47 +0000 Subject: [PATCH 3/3] Update pyproject.toml for release 0.8.0-preview.2 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a34a333..299953e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "xurrent" -version = "0.7.0" +version = "0.8.0-preview.2" authors = [ { name="Fabian Steiner", email="fabian@stei-ner.net" }, ] @@ -18,7 +18,7 @@ Homepage = "https://github.com/fasteiner/xurrent-python" Issues = "https://github.com/fasteiner/xurrent-python/issues" [tool.poetry] name = "xurrent" -version = "0.7.0" +version = "0.8.0-preview.2" description = "A python module to interact with the Xurrent API." authors = ["Ing. Fabian Franz Steiner BSc. "] readme = "README.md"