Skip to content
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
15 changes: 15 additions & 0 deletions .github/scripts/check-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# Checking if current tag matches the package version
current_tag=$(echo $GITHUB_REF | tr -d 'refs/tags/')
file1='version.go'
file_tag1=$(grep 'const VERSION' -A 0 $file1 | cut -d '=' -f2 | tr -d '"' | tr -d ' ')

if [ "$current_tag" != "$file_tag1" ]; then
echo "Error: the current tag does not match the version in package file(s)."
echo "$file1: found $file_tag1 - expected $current_tag"
exit 1
fi

echo 'OK'
exit 0
15 changes: 15 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Validate release version

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
publish:
name: Validate release version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check release validity
run: sh .github/scripts/check-release.sh
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ _[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).

Make a PR updating the version with the new one on this file:
- [`version.go`](/version.go):
```go
const VERSION = "X.X.X"
```

Once the changes are merged on `main`, you can publish the current draft release via the [GitHub interface](https://github.com/meilisearch/meilisearch-go/releases): on this page, click on `Edit` (related to the draft release) > update the description (be sure you apply [these recommandations](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md#writting-the-release-description)) > when you are ready, click on `Publish release`.

<hr>
Expand Down