Release #143
This file contains hidden or 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: Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
concurrency: | |
group: release-drafter | |
jobs: | |
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 }} | |
with: | |
commitish: ${{ github.sha }} | |
- name: Create tag | |
uses: actions/github-script@v8 | |
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: | |
needs: | |
- release-drafter | |
runs-on: ubuntu-latest | |
outputs: | |
full-version: ${{ steps.bootstrap.outputs.full-version }} | |
major-version: ${{ steps.bootstrap.outputs.major-version }} | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
ref: ${{ needs.release-drafter.outputs.tag_name }} | |
- name: Bootstrap Action Workspace | |
id: bootstrap | |
uses: ./.github/actions/bootstrap | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Containers | |
run: ./build.sh publishcontainers | |
build-lambda: | |
needs: | |
- release-drafter | |
uses: ./.github/workflows/build-link-index-updater-lambda.yml | |
with: | |
ref: ${{ needs.release-drafter.outputs.tag_name }} | |
deploy-api-lambda-staging: | |
needs: | |
- release-drafter | |
uses: ./.github/workflows/deploy-api-lambda.yml | |
permissions: | |
id-token: write | |
contents: read | |
with: | |
environment: staging | |
ref: refs/tags/${{ needs.release-drafter.outputs.tag_name }} | |
deploy-link-index-updater-lambda-prod: | |
environment: | |
name: link-index-updater-prod | |
runs-on: ubuntu-latest | |
needs: | |
- build-lambda | |
- release-drafter | |
permissions: | |
contents: write | |
id-token: write | |
env: | |
ZIP_FILE: link-index-updater-lambda.zip | |
steps: | |
- name: Download bootstrap binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: link-index-updater-lambda-binary # Defined in build-link-index-updater-lambda.yml | |
- name: Create zip | |
run: | | |
zip -j "${ZIP_FILE}" ./bootstrap | |
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0 | |
with: | |
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer | |
aws-region: us-east-2 | |
- name: Upload Lambda function | |
run: | | |
aws lambda update-function-code \ | |
--function-name elastic-docs-v3-link-index-updater \ | |
--zip-file "fileb://${ZIP_FILE}" | |
- name: Attach Distribution to release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload --repo ${{ github.repository }} ${{ needs.release-drafter.outputs.tag_name }} "${ZIP_FILE}" | |
release: | |
needs: | |
- containers | |
- release-drafter | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest, macos-latest-large ] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
attestations: write | |
id-token: write | |
outputs: | |
full-version: ${{ steps.bootstrap.outputs.full-version }} | |
major-version: ${{ steps.bootstrap.outputs.major-version }} | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
ref: ${{ needs.release-drafter.outputs.tag_name }} | |
- name: 'Windows only, set TEMP to the same drive' | |
if: ${{ matrix.os == 'windows-latest' }} | |
# temporary waiting for https://github.com/parcel-bundler/parcel/pull/10095 to fix | |
run: | | |
mkdir "D:\\Temp" | |
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV | |
- name: Bootstrap Action Workspace | |
id: bootstrap | |
uses: ./.github/actions/bootstrap | |
- name: Publish Binaries | |
run: ./build.sh publishzip | |
shell: bash | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v3 | |
with: | |
subject-path: | | |
.artifacts/publish/docs-builder/release/*.zip | |
.artifacts/publish/docs-assembler/release/*.zip | |
- name: Attach Distribution to release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
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-drafter | |
- deploy-api-lambda-staging | |
- deploy-link-index-updater-lambda-prod | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
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 --repo ${{ github.repository }} |