Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ permissions:

jobs:
update-release-draft:
concurrency:
group: release-drafter
permissions:
contents: write
pull-requests: read
Expand Down
73 changes: 63 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
name: Pre-release main branch
name: Release

on:
release:
types: [published]

workflow_dispatch:

permissions:
contents: read
packages: write

jobs:

release-drafter:
concurrency:
group: release-drafter
outputs:
tag_name: ${{ steps.release-drafter.outputs.tag_name }}
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: Verify branch
run: |
if [[ "${{ github.ref }}" != refs/heads/main ]]; then
echo "This workflow is only allowed to run on the main branch."
exit 1
fi
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
id: release-drafter
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.release-drafter.outputs.tag_name }}',
sha: context.sha
})

containers:
runs-on: ubuntu-latest
outputs:
Expand All @@ -17,7 +48,8 @@ jobs:

steps:
- uses: actions/checkout@v4

with:
ref: ${{ steps.release-drafter.outputs.tag_name }}
- name: Bootstrap Action Workspace
id: bootstrap
uses: ./.github/actions/bootstrap
Expand All @@ -29,16 +61,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- name: Publish Containers
run: ./build.sh publishcontainers

release-lambda:
runs-on: ubuntu-latest
needs:
- release-drafter
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ steps.release-drafter.outputs.tag_name }}
- name: Amazon Linux 2023 build
run: |
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
Expand All @@ -50,11 +85,13 @@ jobs:
- name: Attach Distribution to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
shell: bash

release:
needs: [containers]
needs:
- containers
- release-drafter
strategy:
fail-fast: false
matrix:
Expand All @@ -70,6 +107,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ steps.release-drafter.outputs.tag_name }}

- name: Bootstrap Action Workspace
id: bootstrap
Expand All @@ -90,6 +129,20 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} .artifacts/publish/docs-builder/release/*.zip
gh release upload ${{ github.event.release.tag_name }} .artifacts/publish/docs-assembler/release/*.zip
gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/publish/docs-builder/release/*.zip
gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/publish/docs-assembler/release/*.zip
shell: bash

publish-release:
needs:
- release
- release-lambda
- release-drafter
runs-on: ubuntu-latest
steps:
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ needs.release-drafter.outputs.tag_name }}
run: |
gh release edit ${{ needs.release-drafter.outputs.tag_name }} --draft=false --latest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ See the [release-drafter configuration](./.github/release-drafter.yml) for more

## Creating a New Release

To create a new release trigger the [release](https://github.com/elastic/docs-builder/actions/workflows/release.yml) workflow on the `main` branch.

Every time a pull request is merged into the `main` branch, release-drafter will
create a draft release or update the existing draft release in the [Releases](https://github.com/elastic/docs-builder/releases) page.

Expand Down
Loading