From 850df81d8d2671be224c9c243e1743032f1e0c69 Mon Sep 17 00:00:00 2001 From: Diogo Gaspar Date: Fri, 20 Dec 2024 22:18:12 +0100 Subject: [PATCH] feat: publish github tag reflecting pypi release --- .github/workflows/publish_on_pypi.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 8f00b669..f3bb6a21 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -11,7 +11,7 @@ on: - completed permissions: - contents: read + contents: write jobs: deploy: @@ -20,11 +20,30 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 + - name: Configure Git + run: | + git config user.name github-actions + git config user.email github-actions@github.com - name: Version bump uses: monperrus/pyproject-bump-pypi@main + id: bump_version with: file_to_bump: "./pyproject.toml" bump_type: "minor" + - name: Commit version bump + run: | + git add pyproject.toml + git commit -m "Bump version to ${{ steps.bump_version.outputs.new_version }}" + git push + - name: Get new version + id: get_version + run: | + VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d '"' -f2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Create and push tag + run: | + git tag v${{ steps.get_version.outputs.version }} + git push origin v${{ steps.get_version.outputs.version }} - name: Install build dependencies run: | python -m pip install --upgrade pip