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
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "9.1.0"
}
17 changes: 17 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "go",
"include-component-in-tag": false,
"include-v-in-tag": true,
"versioning": "always-bump-patch",
"packages": {
".": {
"version-file": "internal/version/version.go"
}
},
"plugins": [
{
"type": "sentence-case"
}
]
}
65 changes: 65 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release

on:
push:
branches:
- '[0-9]*.[0-9]*'

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
release:
name: Release Please
runs-on: ubuntu-latest
steps:
- name: Fetch ephemeral GitHub token
id: fetch-token
uses: elastic/ci-gh-actions/fetch-github-token@8a7604dfdd4e7fe21f969bfe9ff96e17635ea577 # v1.0.0
with:
vault-instance: "ci-prod"

- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release-please
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
target-branch: ${{ github.ref_name }}
token: ${{ steps.fetch-token.outputs.token }}

- name: Checkout repository
if: steps.release-please.outputs.release_created == 'true'
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
token: ${{ steps.fetch-token.outputs.token }}

- name: Bump Version Snapshot
id: bump-version
if: steps.release-please.outputs.release_created == 'true'
run: |
NEXT_PATCH=$((${{ steps.release-please.outputs.patch }} + 1))
NEXT_VERSION="${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}.${NEXT_PATCH}-SNAPSHOT"
echo "Next version: $NEXT_VERSION"
sed -i "s/const Version = \".*\"/const Version = \"$NEXT_VERSION\"/" internal/version/version.go
echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT


- name: Create Version Bump Pull Request
if: steps.release-please.outputs.release_created == 'true'
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
with:
token: ${{ steps.fetch-token.outputs.token }}
commit-message: 'chore: bump version to ${{ steps.bump-version.outputs.next_version }}'
branch: chore/bump-version-${{ steps.bump-version.outputs.next_version }}
delete-branch: true
title: 'chore: bump version to ${{ steps.bump-version.outputs.next_version }}'
body: |
Bumps version to ${{ steps.bump-version.outputs.next_version }} after release ${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}.${{ steps.release-please.outputs.patch }}.

Auto-generated by GitHub Actions.
base: ${{ github.ref_name }}
committer: 'Elastic Machine <elasticmachine@users.noreply.github.com>'
author: 'Elastic Machine <elasticmachine@users.noreply.github.com>'
5 changes: 4 additions & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
package version

// Client returns the client version as a string.
const Client = "9.1.1-SNAPSHOT"
const Client = Version

// Version is the version of the client.
const Version = "9.1.1-SNAPSHOT"