From 92900cb709cffa9bc277cc9b8c26066fd0b18cb9 Mon Sep 17 00:00:00 2001 From: Rohail Taimour Date: Sat, 3 Aug 2024 00:52:21 +0500 Subject: [PATCH] update script --- .github/workflows/release-package.yaml | 11 +++-------- bump_version.py | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-package.yaml b/.github/workflows/release-package.yaml index 42d36e7..2257f85 100644 --- a/.github/workflows/release-package.yaml +++ b/.github/workflows/release-package.yaml @@ -35,8 +35,10 @@ jobs: echo "bump_type=minor" >> $GITHUB_ENV fi - - name: Get package version and changelog body + - name: Launch bump version script run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" poetry run python bump_version.py ${{ env.bump_type }} PACKAGE_VERSION=$(poetry version -s) echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV @@ -44,13 +46,6 @@ jobs: - name: Build Package run: poetry build - - name: Tag Release - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git tag -a v${{ env.PACKAGE_VERSION }} -m "Release v${{ env.PACKAGE_VERSION }}" - git push origin v${{ env.PACKAGE_VERSION }} - - name: Create Release uses: ncipollo/release-action@v1 with: diff --git a/bump_version.py b/bump_version.py index 2bc1a06..83bed10 100644 --- a/bump_version.py +++ b/bump_version.py @@ -47,7 +47,10 @@ def main(): subprocess.run( ["git", "commit", "-am", f"Bump version to {new_version}"], check=True ) - subprocess.run(["git", "tag", f"v{new_version}"], check=True) + subprocess.run( + ["git", "tag", f"v{new_version}", "-m", f"Release v{new_version}"], check=True + ) + subprocess.run(["git", "push", "origin", f"v{new_version}"], check=True) if __name__ == "__main__":