From 3cdd9e51b8f5c4776e720667d87aab49aa6dda88 Mon Sep 17 00:00:00 2001 From: "Michiel De Smet (aider)" Date: Thu, 12 Jun 2025 15:21:15 +0800 Subject: [PATCH 1/4] feat: add version bump and tag release workflows --- .github/workflows/bump-version.yml | 84 ++++++++++++++++++++++++++++++ .github/workflows/tag-release.yml | 30 +++++++++++ 2 files changed, 114 insertions(+) create mode 100644 .github/workflows/bump-version.yml create mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 00000000..9d0b0b90 --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,84 @@ +name: Bump Version +on: + workflow_dispatch: + inputs: + version_part: + description: 'Version part to bump (major, minor, patch)' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +jobs: + bump-version: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install bumpversion + run: | + python -m pip install --upgrade pip + pip install bump2version + + - name: Configure git + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + - name: Get current version + id: current_version + run: | + echo "version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT + + - name: Bump version + id: bump_version + run: | + # Use --no-tag to prevent creating a tag (we'll tag after PR merge) + # Use --no-commit to let create-pull-request handle the commit + bump2version ${{ github.event.inputs.version_part }} --no-tag --no-commit + echo "new_version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT + + - name: Create Pull Request + id: create_pr + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}" + title: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}" + body: | + ## Version Bump + + This PR bumps the version from `${{ steps.current_version.outputs.version }}` to `${{ steps.bump_version.outputs.new_version }}`. + + ### Changes + - Updated version in `setup.py` + - Updated version in `docs/conf.py` + - Updated version in `src/datapilot/__init__.py` + - Updated version in `.bumpversion.cfg` + + ### Type of change + - Version bump (${{ github.event.inputs.version_part }}) + + --- + *This PR was automatically created by the bump version workflow.* + branch: bump-version-${{ steps.bump_version.outputs.new_version }} + delete-branch: true + labels: | + version-bump + automated diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 00000000..dafaabdb --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,30 @@ +name: Tag Release +on: + pull_request: + types: [closed] + branches: [main] + +jobs: + tag-release: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'version-bump') + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get version from file + id: get_version + run: | + echo "version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT + + - name: Create and push tag + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}" + git push origin "v${{ steps.get_version.outputs.version }}" From 0b4b182ea6ad42b18abcb2d016f52642bf9a3ec8 Mon Sep 17 00:00:00 2001 From: "Michiel De Smet (aider)" Date: Thu, 12 Jun 2025 15:22:56 +0800 Subject: [PATCH 2/4] ci: add PyPI publishing to tag release workflow --- .github/workflows/tag-release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index dafaabdb..2debd0e5 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -17,6 +17,16 @@ jobs: with: fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox twine wheel setuptools + - name: Get version from file id: get_version run: | @@ -28,3 +38,12 @@ jobs: git config --local user.name "github-actions[bot]" git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}" git push origin "v${{ steps.get_version.outputs.version }}" + + - name: Make release script executable + run: chmod +x release.sh + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: ./release.sh From 90d6df2c702620f4ff130d2137a16f815c61df59 Mon Sep 17 00:00:00 2001 From: Michiel De Smet Date: Thu, 12 Jun 2025 15:24:07 +0800 Subject: [PATCH 3/4] ci: update GitHub workflows for version bump and release --- .github/workflows/bump-version.yml | 24 ++++++++++++------------ .github/workflows/tag-release.yml | 14 +++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 9d0b0b90..14920761 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -11,41 +11,41 @@ on: - major - minor - patch - + jobs: bump-version: runs-on: ubuntu-latest permissions: contents: write pull-requests: write - + steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - + - name: Install bumpversion run: | python -m pip install --upgrade pip pip install bump2version - + - name: Configure git run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - + - name: Get current version id: current_version run: | echo "version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT - + - name: Bump version id: bump_version run: | @@ -53,7 +53,7 @@ jobs: # Use --no-commit to let create-pull-request handle the commit bump2version ${{ github.event.inputs.version_part }} --no-tag --no-commit echo "new_version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT - + - name: Create Pull Request id: create_pr uses: peter-evans/create-pull-request@v5 @@ -63,18 +63,18 @@ jobs: title: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}" body: | ## Version Bump - + This PR bumps the version from `${{ steps.current_version.outputs.version }}` to `${{ steps.bump_version.outputs.new_version }}`. - + ### Changes - Updated version in `setup.py` - Updated version in `docs/conf.py` - Updated version in `src/datapilot/__init__.py` - Updated version in `.bumpversion.cfg` - + ### Type of change - Version bump (${{ github.event.inputs.version_part }}) - + --- *This PR was automatically created by the bump version workflow.* branch: bump-version-${{ steps.bump_version.outputs.new_version }} diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 2debd0e5..19e3d6e8 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -10,38 +10,38 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - + steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install tox twine wheel setuptools - + - name: Get version from file id: get_version run: | echo "version=$(grep current_version .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')" >> $GITHUB_OUTPUT - + - name: Create and push tag run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release version ${{ steps.get_version.outputs.version }}" git push origin "v${{ steps.get_version.outputs.version }}" - + - name: Make release script executable run: chmod +x release.sh - + - name: Publish to PyPI env: TWINE_USERNAME: __token__ From 5fd3d5ad998a0f19b142a85a48f0d064f779099e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:47:35 +0000 Subject: [PATCH 4/4] Initial plan