Skip to content

Commit

Permalink
[release] improve release steps naming (#279)
Browse files Browse the repository at this point in the history
* rename step 1

* add PR title and body arguments

* rename step 3

* clarify project version check

* update readme about the release process
  • Loading branch information
SylvainJuge authored Jun 5, 2024
1 parent 35bdec6 commit c42467f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ Whenever a merge to the main or branches, the whole workflow will be compiled an

### Release process

This process has been fully automated, and it gets triggered manually when the [release](https://github.com/elastic/elastic-otel-java/actions/workflows/release.yml) workflow is being run. It runs a Buildkite pipeline in charge of generating and publishing the artifacts; for further details, please go to [the Buildkite folder](../../.buildkite/README.md).
To release a new version of elastic-otel-java, you must use two GitHub Workflows.

- Trigger the `release-step-1` GH workflow
- parameters: version to release
- will open `release-step-2` PR
- Review and merge the `release-step-2` PR to `main` (version bump to release)
- Trigger the `release-step-3` GH workflow
- parameters: version to release and the `main` branch (or merge commit/ref of `release-step-2` PR merge).
- will generate and publish release artifact through [buildkite](../../.buildkite/release.yml).
- will open `release-step-4` PR
- Review and merge the `release-step-4` PR to `main` (version bump from release to next snapshot version)

The tag release follows the naming convention: `v.<major>.<minor>.<patch>`, where `<major>`, `<minor>` and `<patch>`.

The release automation raises a Pull Request with the next version.

### OpenTelemetry

A GitHub workflow is responsible for populating the workflows regarding jobs and steps. Those details can be seen [here](https://ela.st/oblt-ci-cd-stats) (**NOTE**: only available for Elasticians).
12 changes: 10 additions & 2 deletions .github/workflows/pre-post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ on:
description: 'Pre or post release phase'
type: string # valid values are 'pre' or 'post'
required: true
pr_title:
description: 'pull-request title'
type: string
required: true
pr_body:
description: : 'pull-request body'
type: string
required: true

env:
RELEASE_VERSION: ${{ inputs.version }}
Expand Down Expand Up @@ -90,8 +98,8 @@ jobs:
git add --all
git commit -m "${{ inputs.phase }} release: elastic-otel-java v${{ env.RELEASE_VERSION }}"
git push origin ${{ env.BRANCH_NAME }}
- name: Create the ${{ inputs.phase }} release PR
run: gh pr create --title="${{ inputs.phase }} release v${{ env.RELEASE_VERSION }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.phase }} release v${{ env.RELEASE_VERSION }}"
run: gh pr create --title="${{ inputs.pr_title }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.pr_body }}"
env:
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Pre release
name: release-step-1

on:
workflow_dispatch:
Expand Down Expand Up @@ -29,4 +29,6 @@ jobs:
ref: ${{ inputs.ref }}
version: ${{ inputs.version }}
phase: 'pre'
pr_title: "[release] release-step-2 ${{ inputs.version }}"
pr_body: "Step 2 of the release process for version ${{ inputs.version }}: review & merge, then execute 'release-step-3' GH workflow"
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Release
name: release-step-3

on:
workflow_dispatch:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
uses: ./.github/workflows/validate-tag
with:
tag: ${{ env.RELEASE_VERSION_TAG }}
- name: Validate tag match current version
- name: Validate tag match current gradle project version
run: |
if [ "$(./gradlew -q currentVersion)" != "${{ env.RELEASE_VERSION }}" ]; then
echo "Tag should match version set in 'version.properties'"
Expand Down Expand Up @@ -210,6 +210,8 @@ jobs:
ref: ${{ inputs.ref }}
version: ${{ inputs.version }}
phase: 'post'
pr_title: "[release] release-step-4 ${{ inputs.version }}"
pr_body: "Step 4 of the release process for version ${{ inputs.version }}: review & merge"
secrets: inherit

create-github-release:
Expand Down

0 comments on commit c42467f

Please sign in to comment.