forked from aws/karpenter-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (68 loc) · 2.38 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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']
});