Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
74 changes: 74 additions & 0 deletions .github/workflows/run-minor-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,84 @@ permissions:
contents: read

env:
<<<<<<< HEAD
SLACK_CHANNEL: "#apm-server-test-release"

=======
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_CHANNEL: "#apm-server"

>>>>>>> 8e1eb2984 (ci: use ephemeral tokens (#14217))
jobs:
run-minor:
runs-on: ubuntu-latest
steps:
<<<<<<< HEAD
- uses: actions/checkout@v4
=======

- uses: elastic/oblt-actions/slack/[email protected]
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ env.SLACK_CHANNEL }}
message: |-
Feature freeze for `${{ github.repository }}@${{ env.RELEASE_VERSION }}` just started.
The `${{ github.repository }}@${{ env.RELEASE_BRANCH }}` branch will be created Today.
thread-timestamp: ${{ needs.prepare.outputs.slack-thread || '' }}

- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"contents": "write",
"pull_requests": "write"
}

- 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 git user
uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ steps.get_token.outputs.token }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.APM_SERVER_RELEASE_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.APM_SERVER_RELEASE_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- run: make minor-release
env:
GH_TOKEN: ${{ steps.get_token.outputs.token }}

- if: success()
uses: elastic/oblt-actions/slack/[email protected]
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ env.SLACK_CHANNEL }}
message: |-
`${{ github.repository }}@${{ env.RELEASE_BRANCH }}` is now available.
The docs and other references are updated. You can start using it.
thread-timestamp: ${{ needs.prepare.outputs.slack-thread || '' }}

- if: failure()
uses: elastic/oblt-actions/slack/[email protected]
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ env.SLACK_CHANNEL }}
message: |-
:fire: Something went wrong with the release. See <${{ env.JOB_URL }}|logs>.
thread-timestamp: ${{ needs.prepare.outputs.slack-thread || '' }}
>>>>>>> 8e1eb2984 (ci: use ephemeral tokens (#14217))
17 changes: 15 additions & 2 deletions .github/workflows/run-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ permissions:
env:
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_CHANNEL: "#apm-server"
GH_TOKEN: ${{ secrets.APM_SERVER_RELEASE_TOKEN }}

jobs:
prepare:
Expand Down Expand Up @@ -54,13 +53,25 @@ jobs:
# Use the makefile in the given release branch.
ref: ${{ env.RELEASE_BRANCH }}

- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"contents": "write",
"pull_requests": "write"
}

# 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 git user
uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ env.GH_TOKEN }}
github-token: ${{ steps.get_token.outputs.token }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
Expand All @@ -71,6 +82,8 @@ jobs:
git_commit_gpgsign: true

- run: make patch-release
env:
GH_TOKEN: ${{ steps.get_token.outputs.token }}

- if: success()
uses: elastic/oblt-actions/slack/send@v1
Expand Down