release.yaml•3.1 kB
name: Release
on:
push:
# Only release on supported semantic version tagging e.g. v0.0.1-rc.0
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
jobs:
release:
permissions:
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
contents: write # marvinpinto/action-automatic-releases@v1.2.1
pull-requests: write # name: Create PR
if: github.repository == 'aws/karpenter-provider-aws'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
- uses: ./.github/actions/install-deps
with:
use-cache: false
- uses: ./.github/actions/e2e/install-helm
with:
version: v3.18.6
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
with:
role-to-assume: 'arn:aws:iam::${{ vars.RELEASE_ACCOUNT_ID }}:role/${{ vars.RELEASE_ROLE_NAME }}'
aws-region: ${{ vars.RELEASE_REGION }}
- run: make release
env:
RELEASE_ACCOUNT_ID: ${{ vars.RELEASE_ACCOUNT_ID }}
CACHED_ECR_NAME: ${{ vars.CACHED_ECR_NAME }}
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
with:
role-to-assume: 'arn:aws:iam::${{ vars.READONLY_ACCOUNT_ID }}:role/${{ vars.READONLY_ROLE_NAME }}'
aws-region: ${{ vars.READONLY_REGION }}
- 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
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const { repo, owner } = context.repo;
const tag = context.ref.replace("refs/tags/", '');
const result = await github.rest.pulls.create({
title: `chore: Release ${tag}`,
owner,
repo,
head: `release-${tag}`,
base: 'main',
body: [
`Stable Release Changes for ${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-provider-aws/actions/workflows/stable-release.yml).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['stable-release','website','helm-charts']
});