forked from aws/karpenter-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.9 KB
/
snapshot-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
name: SnapshotRelease
on:
workflow_run:
workflows: [ApprovalComment]
types: [completed]
permissions:
id-token: write
pull-requests: write
contents: write
statuses: write
jobs:
release:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/download-artifact
- name: Parse artifacts and assign GA environment variables
run: |
repo=$(head -n 1 /tmp/artifacts/metadata.txt)
pr_number=$(head -n 1 /tmp/artifacts/metadata.txt)
pr_commit=$(tail -n 1 /tmp/artifacts/metadata.txt)
echo "PR_COMMIT=$pr_commit" >> $GITHUB_ENV
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: ${{ env.PR_COMMIT }}
- uses: ./.github/actions/commit-status/start
with:
name: "${{ github.workflow }} / ${{ github.job }} (pull_request_review)"
git_ref: ${{ env.PR_COMMIT }}
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/authenticate-aws
- run: make release
env:
GH_PR_NUMBER: ${{env.PR_NUMBER}}
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: `${{env.PR_NUMBER}}`,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Snapshot successfully published to `oci://public.ecr.aws/karpenter/karpenter:v0-${{env.PR_COMMIT}}`. Find the image tag and installation instructions at https://gallery.ecr.aws/karpenter/karpenter/'
})
- if: always()
uses: ./.github/actions/commit-status/end
with:
name: "${{ github.workflow }} / ${{ github.job }} (pull_request_review)"
git_ref: ${{ env.PR_COMMIT }}