Skip to content

Release

Release #587

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [ReleaseTrigger]
types: [completed]
permissions:
id-token: write
pull-requests: write
contents: write
jobs:
release:
if: github.event.workflow_run.conclusion == 'success' && contains(fromJson('["push"]'), github.event.workflow_run.event)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/download-artifact
- run: |
tag=$(head -n 1 /tmp/artifacts/metadata.txt)
tag_commit=$(tail -n 1 /tmp/artifacts/metadata.txt)
echo "TAG_COMMIT=$tag_commit" >> $GITHUB_ENV
echo "TAG=$tag" >> $GITHUB_ENV
- name: Checkout the repository out again at the given SHA from the artifact
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.TAG_COMMIT }}
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/authenticate-aws
- uses: ./.github/actions/authenticate-ghcr
with:
actor: ${{ github.actor }}
secret: ${{ secrets.GITHUB_TOKEN }}
- run: make release
- run: make docgen
- run: make prepare-website
if: env.TAG != 'no tag'
- run: make stable-release-pr
if: env.TAG != 'no tag'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
- name: Create PR
if: env.TAG != 'no tag'
uses: actions/github-script@v6
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'chore: Release ${{ env.TAG }}',
owner,
repo,
head: 'release-${{ env.TAG }}',
base: 'main',
body: [
'Stable Release Changes for ${{ env.TAG }}.',
'Please disregard this PR if it is for a patch release.',
'Please remove the branch after merging.',
'This PR is generated by [StableRelease](https://github.com/aws/karpenter/actions/workflows/stable-release.yml).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['stable-release','website','helm-charts']
});