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

[release] improve release steps naming #3667

Merged
merged 5 commits into from
Jun 4, 2024
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
6 changes: 5 additions & 1 deletion .ci/release/update-major-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@ git checkout -b "update-major-${v}"
git push origin "update-major-${v}"

echo -e "\n--- create PR to update major branch"
gh pr create --title="post release v${v}: update major branch" --base "${major_branch}" --head "update-major-${v}" -b "post release v${v}"
gh pr create \
--title="[release] release-step-4 ${v}" \
--base "${major_branch}" \
--head "update-major-${v}" \
-b "Step 4 of the release process for version ${v}: review & merge with merge commit WITHOUT SQUASH to prevent conflicts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea to add the instructions here!

17 changes: 12 additions & 5 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ Every time there is a merge to main or any branches the whole workflow will comp
### Release process

To release a new version of apm-agent-java, you must use the two GitHub Workflows.
Trigger the `Pre Release` workflow targeting the release version.
After merging the PRs created by the first workflow, you can trigger the `Release` workflow targeting the release version.
It runs then a Buildkite pipeline in charge of generating and publishing the artifacts,
for further details please go to [the buildkite folder](../../.buildkite/README.md).
Finally, merge the PRs created to bump version for the next iteration.

- 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 + changelog update)
- 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/README.md).
- will open two PRs: `release-step-4` and `release-step-5`
- will wait on the `release-step-4` PR to be merged and published (documentation update)
- Review and merge the `release-step-4` PR to the "major branch", which is currently `1.x`, the documentation effective build and publication can take a while.
- Review and merge the `release-step-5` 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>`.

Expand Down
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 @@ -91,8 +99,8 @@ jobs:
git add --all
git commit -m "${{ inputs.phase }} release: elastic-apm-agent ${{ env.RELEASE_VERSION_TAG }}"
git push origin ${{ env.BRANCH_NAME }}

- name: Create the ${{ inputs.phase }} release PR
run: gh pr create --title="${{ inputs.phase }} release ${{ env.RELEASE_VERSION_TAG }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.phase }} release ${{ env.RELEASE_VERSION_TAG }}"
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 @@
---
# Releases the agent
name: release
name: 'release-step-3'

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:
required: true
default: "main"
version:
description: 'The version to release (e.g. 1.2.3). This workflow will automatically perform the required version bumps'
description: 'The version to release (e.g. 1.2.3). This workflow will automatically perform the required post-release version bumps'
required: true
skip_preparation:
description: |
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
uses: ./.github/workflows/validate-tag
with:
tag: ${{ env.RELEASE_VERSION_TAG }}
- name: Validate tag match current version
- name: Validate tag match current maven project version
run: |
if [ "$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout)" != "${{ env.RELEASE_VERSION }}" ]; then
echo "Tag should match pom.xml project.version"
Expand Down Expand Up @@ -212,6 +212,8 @@ jobs:
ref: ${{ inputs.ref }}
version: ${{ inputs.version }}
phase: 'post'
pr_title: "[release] release-step-5 ${{ inputs.version }}"
pr_body: "Step 5 of the release process for version ${{ inputs.version }}: review & merge"
secrets: inherit

update-major-branch:
Expand Down
Loading