-
Notifications
You must be signed in to change notification settings - Fork 519
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
ci(release): automate release steps for the minor #12233
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
362bfd6
ci(release): automate release steps
v1v d496968
Merge remote-tracking branch 'upstream/main' into feature/automate-re…
v1v 170be4c
refactor a bit
v1v 14b37df
report non supported versions
v1v 01a46d9
rename make goals and add some docs
v1v 5160ab9
cosmetic changes in the slack messages
v1v 26b7c55
support slack threads
v1v 1e6b4b6
fix
v1v e530a73
chore
v1v 0144e15
chore
v1v 40c915e
refactor: patch
v1v f23de22
refactor: minor
v1v 40e1680
fix
v1v 6bde939
use slack channel env
v1v 7bb4582
use output slack-thread
v1v 677b466
avoid concurrency
v1v 73b1a28
support full checkout and validaitons
v1v e33feb6
notify what's the error if any failure
v1v bf6e5f7
fix
v1v 12453ef
chore
v1v 01248e5
initial
v1v 04ce400
exclude
v1v e4af33a
chore
v1v 6e60869
enable mergify and yq
v1v 299e6d8
update mergify if required
v1v 05de44a
Revert "update mergify if required"
v1v 29f763d
update mergify if required
v1v d09fd29
use RELEASE_BRANCH
v1v eb68c73
fix
v1v e0cf89e
support prs
v1v 15b91e5
run only if things were created correctly
v1v 5ea611e
fix
v1v 887517d
force branch
v1v 2ed60df
refactor
v1v 6c4aa1b
refactor
v1v eb57f2b
github warn
v1v adf652e
enable
v1v bccf6bc
set makefile and use variable
v1v 09fcacc
fix
v1v 0096080
fix
v1v 8090f3e
create head
v1v ae0ee78
update changelog
v1v 5d36ebc
replace compare
v1v ac67c09
modify
v1v 9d78692
partial
v1v 61b6658
fix
v1v 8abd8e6
fix
v1v 995c0ac
refactor
v1v c36a7c5
docs
v1v a1e1d64
test
v1v 6668224
action: grant permissions
v1v 0bfd73e
notify if failrues
v1v bd4087f
use base branch
v1v 53202e9
fix hardcoded value
v1v 8ce0aa4
remove leaving directory
v1v 710c429
cannot user github bot to create PRs
v1v 532a45f
chore
v1v 488da7f
enable
v1v 8087b19
chore
v1v 9e976b3
fix
v1v a7b9237
production
v1v 9781ad0
use release version
v1v db90eb6
Merge remote-tracking branch 'upstream/main' into feature/automate-re…
v1v a1afb16
support for https://github.com/elastic/apm-server/pull/12251
v1v 6a7bd31
Merge branch 'main' into feature/automate-release-process
simitt b8db352
Merge branch 'main' into feature/automate-release-process
simitt 586f00e
Merge branch 'main' into feature/automate-release-process
carsonip f8e804f
Merge branch 'main' into feature/automate-release-process
v1v 3d01476
Merge branch 'main' into feature/automate-release-process
kruskall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
--- | ||
name: prepare-release | ||
description: Common tasks for preparing minor and patch releases | ||
|
||
inputs: | ||
type: | ||
description: 'Release type (minor or patch)' | ||
required: true | ||
version: | ||
description: 'The version' | ||
required: true | ||
vault-url: | ||
description: 'Vault URL' | ||
required: true | ||
vault-role-id: | ||
description: 'Vault role ID' | ||
required: true | ||
vault-secret-id: | ||
description: 'Vault secret ID' | ||
required: true | ||
|
||
outputs: | ||
release-branch: | ||
description: "Release branch (relevant for minor releases)" | ||
value: ${{ steps.generate.outputs.release-branch }} | ||
release-version: | ||
description: "Release version" | ||
value: ${{ steps.generate.outputs.release-version }} | ||
slack-thread: | ||
description: "Slack thread id" | ||
value: ${{ steps.slack-thread.outputs.threadTimestamp }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Send slack message when started | ||
id: slack-thread | ||
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | ||
with: | ||
url: ${{ inputs.vault-url }} | ||
roleId: ${{ inputs.vault-role-id }} | ||
secretId: ${{ inputs.vault-secret-id }} | ||
channel: ${{ env.SLACK_CHANNEL }} | ||
message: ":wave: This is the thread for the ${{ inputs.type }} release `${{ github.repository }}@${{ env.VERSION }}`. (<${{ env.JOB_URL }}|workflow run>)" | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
|
||
- id: generate | ||
run: |- | ||
echo "release-branch=${VERSION%.*}" >> "${GITHUB_OUTPUT}" | ||
echo "release-version=${VERSION}" >> "${GITHUB_OUTPUT}" | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
shell: 'bash' | ||
|
||
- name: validate version format (minor only) | ||
if: ${{ inputs.type == 'minor' && ! endsWith(inputs.version, '0') }} | ||
run: |- | ||
FAILURE_MESSAGE='version is not a minor one but a patch (only support for <major>.<minor>.0)' | ||
echo "FAILURE_MESSAGE=${FAILURE_MESSAGE}" >> "$GITHUB_ENV" | ||
echo "::error::${FAILURE_MESSAGE}" ; exit 1 | ||
shell: 'bash' | ||
|
||
- name: validate version format (patch only) | ||
if: ${{ inputs.type == 'patch' && endsWith(inputs.version, '0') }} | ||
run: |- | ||
FAILURE_MESSAGE='version is not a patch one but a minor (only support for <major>.<minor>.[1-9]+[0-9]*)' | ||
echo "FAILURE_MESSAGE=${FAILURE_MESSAGE}" >> "$GITHUB_ENV" | ||
echo "::error::${FAILURE_MESSAGE}" ; exit 1 | ||
shell: 'bash' | ||
|
||
- name: validate if branch already exists (minor only) | ||
if: ${{ inputs.type == 'minor' }} | ||
run: |- | ||
if git ls-remote --exit-code --heads https://github.com/${{ github.repository }}.git "$BRANCH" > /dev/null ; then | ||
FAILURE_MESSAGE='Branch already exists. This is not a minor release.' | ||
echo "FAILURE_MESSAGE=${FAILURE_MESSAGE}" >> "$GITHUB_ENV" | ||
echo "::error::${FAILURE_MESSAGE}" ; exit 1 | ||
fi | ||
shell: 'bash' | ||
env: | ||
BRANCH: ${{ steps.generate.outputs.release-branch }} | ||
|
||
- name: validate if tag already exists | ||
run: |- | ||
if git ls-remote --exit-code https://github.com/${{ github.repository }}.git "$TAG" > /dev/null ; then | ||
FAILURE_MESSAGE='Tag already exists.' | ||
echo "FAILURE_MESSAGE=${FAILURE_MESSAGE}" >> "$GITHUB_ENV" | ||
echo "::error::${FAILURE_MESSAGE}" ; exit 1 | ||
fi | ||
shell: 'bash' | ||
env: | ||
TAG: 'refs/tags/v${{ steps.generate.outputs.release-version }}' | ||
|
||
- uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | ||
if: failure() | ||
with: | ||
url: ${{ inputs.vault-url }} | ||
roleId: ${{ inputs.vault-role-id }} | ||
secretId: ${{ inputs.vault-secret-id }} | ||
channel: ${{ env.SLACK_CHANNEL }} | ||
threadTimestamp: ${{ steps.slack-thread.outputs.threadTimestamp || '' }} | ||
message: |- | ||
:fire: Something went wrong with the ${{ inputs.type }} release preparation. It failed with the below error message: | ||
`${{ env.FAILURE_MESSAGE }}`. | ||
See <${{ env.JOB_URL }}|logs>. | ||
env: | ||
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help run some pre-flight validations