Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation version update #875

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update library version

on:
workflow_dispatch:
inputs:
new_version:
description: 'The new version (vX.Y.Z)'
required: true

env:
NEW_VERSION: ${{ github.event.inputs.new_version }}
NEW_BRANCH: update-version-${{ github.event.inputs.new_version }}
GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }}

jobs:
update-version:
name: Update version in version.py
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update version.py file
run: |
raw_new_version=$(echo $NEW_VERSION | cut -d 'v' -f 2)
new_string="__version__ = \"$raw_new_version\""
sed -i "s/^__version__ = .*/$new_string/" meilisearch/version.py
- name: Commit and push the changes to the ${{ env.NEW_BRANCH }} branch
uses: EndBug/add-and-commit@v9
with:
message: "Update version for the next release (${{ env.NEW_VERSION }}) in version.py"
new_branch: ${{ env.NEW_BRANCH }}
- name: Create the PR pointing to ${{ github.ref_name }}
run: |
gh pr create \
--title "Update version for the next release ($NEW_VERSION)" \
--body '⚠️ This PR is automatically generated. Check the new version is the expected one.' \
--label 'skip-changelog' \
--base $GITHUB_REF_NAME
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
- [How to Contribute](#how-to-contribute)
- [Development Workflow](#development-workflow)
- [Git Guidelines](#git-guidelines)
- [Release Process (for internal team only)](#release-process-for-internal-team-only)
- [Release Process (for the internal team only)](#release-process-for-the-internal-team-only)

## Assumptions

Expand Down Expand Up @@ -130,6 +130,10 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m

⚠️ Before doing anything, make sure you got through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md).

Use [our automation](https://github.com/meilisearch/meilisearch-python/actions/workflows/update-version.yml) to update the version: click on `Run workflow``, and fill the appropriate version before validating. A PR updating the version in the `version.py` file will be created.

Or do it manually:

Make a PR modifying the file [`meilisearch/version.py`](/meilisearch/version.py) with the right version.

```python
Expand Down