From a318778d2a10134d9d6f4350cf764218d4b43ac4 Mon Sep 17 00:00:00 2001 From: gsilvestrin Date: Mon, 12 Jun 2023 13:59:08 -0700 Subject: [PATCH] feat(python): add action to tag python releases (#172) --- .../workflows/python-make-release-commit.yml | 56 +++++++++++++++++++ python/.bumpversion.cfg | 8 +++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/python-make-release-commit.yml create mode 100644 python/.bumpversion.cfg diff --git a/.github/workflows/python-make-release-commit.yml b/.github/workflows/python-make-release-commit.yml new file mode 100644 index 00000000..4f4fbd66 --- /dev/null +++ b/.github/workflows/python-make-release-commit.yml @@ -0,0 +1,56 @@ +name: [Python] Create release commit + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run (create the local commit/tags but do not push it)' + required: true + default: "false" + type: choice + options: + - "true" + - "false" + part: + description: 'What kind of release is this?' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + - name: Check out main + uses: actions/checkout@v3 + with: + ref: main + persist-credentials: false + fetch-depth: 0 + lfs: true + - name: Set git configs for bumpversion + shell: bash + run: | + git config user.name 'Lance Release' + git config user.email 'lance-dev@lancedb.com' + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Bump version, create tag and commit + working-directory: python + run: | + pip install bump2version + bumpversion --verbose ${{ inputs.part }} + - name: Push new version and tag + if: ${{ inputs.dry_run }} == "false" + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }} + branch: main + tags: true + diff --git a/python/.bumpversion.cfg b/python/.bumpversion.cfg new file mode 100644 index 00000000..4079491a --- /dev/null +++ b/python/.bumpversion.cfg @@ -0,0 +1,8 @@ +[bumpversion] +current_version = 0.1.6 +commit = True +message = [python] Bump version: {current_version} → {new_version} +tag = True +tag_name = python-v{new_version} + +[bumpversion:file:pyproject.toml]