Skip to content

Release

Release #779

Workflow file for this run

name: Release
on:
push:
tags: [ 'v*.*.*' ]
permissions:
id-token: write
pull-requests: write
contents: write
jobs:
release:
if: github.repository == 'aws/karpenter'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create GitHub Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
- name: Save commit tag to environment
run: |
TAG=$(git describe --tags --exact-match)
echo "TAG=${TAG}" >> $GITHUB_ENV
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/e2e/install-helm
with:
version: v3.12.3 # Pinned to this version since v3.13.0 has issues with pushing to public ECR: https://github.com/helm/helm/issues/12442
- uses: aws-actions/[email protected]
with:
role-to-assume: 'arn:aws:iam::${{ vars.ECR_ACCOUNT_ID }}:role/${{ vars.ECR_RELEASE_ROLE_NAME }}'
aws-region: ${{ vars.ECR_REGION }}
- run: make release
- run: make docgen
- run: make prepare-website
- run: make stable-release-pr
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']
});