run-patch-release #17
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
--- | |
name: run-patch-release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The version (semver format: major.minor.patch)' | |
required: true | |
type: string | |
# Avoid concurrency so we can watch the releases correctly | |
concurrency: | |
group: ${{ github.workflow }} | |
permissions: | |
contents: read | |
env: | |
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
SLACK_CHANNEL: "#apm-server" | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
release-branch: ${{ steps.prepare.outputs.release-branch }} | |
release-version: ${{ steps.prepare.outputs.release-version }} | |
slack-thread: ${{ steps.prepare.outputs.slack-thread }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: prepare | |
uses: ./.github/workflows/prepare-release | |
with: | |
vault-url: ${{ secrets.VAULT_ADDR }} | |
vault-role-id: ${{ secrets.VAULT_ROLE_ID }} | |
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }} | |
version: ${{ inputs.version }} | |
type: 'patch' | |
run-patch: | |
runs-on: ubuntu-latest | |
needs: [ prepare ] | |
env: | |
RELEASE_BRANCH: ${{ needs.prepare.outputs.release-branch }} | |
RELEASE_VERSION: ${{ needs.prepare.outputs.release-version }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# 0 indicates all history for all branches and tags. | |
fetch-depth: 0 | |
# Use the makefile in the given release branch. | |
ref: ${{ env.RELEASE_BRANCH }} | |
# Required to use a service account, otherwise PRs created by | |
# GitHub bot won't trigger any CI builds. | |
# See https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-537478081 | |
- name: Configure github token | |
uses: elastic/apm-pipeline-library/.github/actions/github-token@current | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
- name: Configure git user | |
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current | |
with: | |
username: ${{ env.GIT_USER }} | |
email: ${{ env.GIT_EMAIL }} | |
token: ${{ env.GITHUB_TOKEN }} | |
- run: make patch-release | |
env: | |
GH_TOKEN: ${{ env.GITHUB_TOKEN }} | |
- uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | |
if: success() | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
channel: ${{ env.SLACK_CHANNEL }} | |
threadTimestamp: ${{ needs.prepare.outputs.slack-thread || '' }} | |
message: |- | |
Feature freeze for `${{ github.repository }}@${{ env.RELEASE_VERSION }}` is Today. | |
All the relevant PRs and issues have been created. | |
- uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | |
if: failure() | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
channel: ${{ env.SLACK_CHANNEL }} | |
threadTimestamp: ${{ needs.prepare.outputs.slack-thread || '' }} | |
message: |- | |
:fire: Something went wrong with the patch release. See <${{ env.JOB_URL }}|logs>. |