run-minor-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-minor-release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The version (semver format: major.minor.0)' | |
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: 'minor' | |
run-minor: | |
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: elastic/apm-pipeline-library/.github/actions/slack-message@current | |
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 }}` just started. | |
The `${{ github.repository }}@${{ env.RELEASE_BRANCH }}` branch will be created Today. | |
- uses: actions/checkout@v4 | |
with: | |
# 0 indicates all history for all branches and tags. | |
fetch-depth: 0 | |
# 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 minor-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: |- | |
`${{ github.repository }}@${{ env.RELEASE_BRANCH }}` is now available. | |
The docs and other references are updated. You can start using it. | |
- 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 release. See <${{ env.JOB_URL }}|logs>. |