Skip to content

run-minor-release

run-minor-release #3

---
name: run-minor-release
on:
workflow_dispatch:
inputs:
version:
description: 'The version (semver format: major.minor.patch)'
required: true
type: string
permissions:
contents: read
env:
SLACK_CHANNEL: "#apm-server-test-release"
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
release-branch: ${{ steps.generate.outputs.release-branch }}
release-version: ${{ steps.generate.outputs.release-version }}
slack-thread: ${{ steps.slack-thread.outputs.threadTimestamp }}
steps:
- name: Send slack message when started
id: slack-thread
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 }}
message: ":wave: This is the thread for the patch release `${{ github.repository }}@${{ env.VERSION }}`. (<${{ env.JOB_URL }}|workflow run>)"
env:
VERSION: ${{ inputs.version }}
- name: process input
id: generate
run: |-
echo "release-branch=${VERSION%.*}" >> "${GITHUB_OUTPUT}"
echo "release-version=${VERSION}" >> "${GITHUB_OUTPUT}"
env:
VERSION: ${{ inputs.version }}
- name: validate input
if: ${{ ! endsWith(inputs.version, '0') }}
run: echo '::error::version is not a minor one but a patch (only support for <major>.<minor>.0)' ; exit 1
- 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: ${{ steps.slack-thread.outputs.threadTimestamp || '' }}
message: Something went wrong with the minor release preparation. See <${{ env.JOB_URL }}|logs>
run-minor:
runs-on: ubuntu-latest
needs: [ prepare ]
env:
RELEASE_BRANCH: ${{ needs.prepare.outputs.release-branch }}
RELEASE_VERSION: ${{ needs.prepare.outputs.release-version }}
steps:
- uses: actions/checkout@v4
- 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.
And `${{ github.repository }}@${{ env.RELEASE_BRANCH }}` will be created **Today**.
- run: make minor-release
- 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: |-
`${{ github.repository }}@${{ env.RELEASE_BRANCH }}` is now available.
And the docs and other references are updated. You can start using it.