-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (121 loc) · 4.82 KB
/
releaser-dispatcher.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: "Helm Charts CI"
on:
push:
branches:
- main
paths:
- charts/**/**
workflow_dispatch:
inputs:
chartName:
required: true
description: "Name of Helm Chart to be released to the chart repo. Check the index/README for full list."
env:
GH_ACTIONS_MODE: true
jobs:
publish-ci:
name: Tag and publish chart changes
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' }}
env:
RELEASES_GPG_PASSPHARSE: ${{ secrets.RELEASES_GPG_PASSPHARSE }}
RELEASES_GPG_KEY: ${{ secrets.RELEASES_GPG_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: ./scripts/setup-ci
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GH_SERVICE_ACCOUNT_API_KEY }}"
# If failed, do this
- name: Notify people over Discord and Guilded for failed CI
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
webhook: |
${{ secrets.NOTIFICATIONS_DISCORD_WEBHOOK }}
${{ secrets.NOTIFICATIONS_GUILDED_WEBHOOK }}
status: ${{ job.status }}
title: "Chart Releaser failed"
description: "The releaser bot is having problems. Please check the CI logs for details."
nofail: false
nodetail: false
username: Github Actions
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
- name: Notify people over Discord and Guilded for successfully release
if: ${{ success() }}
uses: sarisia/actions-status-discord@v1
with:
webhook: |
${{ secrets.NOTIFICATIONS_DISCORD_WEBHOOK }}
${{ secrets.NOTIFICATIONS_GUILDED_WEBHOOK }}
status: ${{ job.status }}
title: "Charts Releaser Success"
description: "Everything is fine, the releaser bot is probably fine."
nofail: false
nodetail: false
username: Github Actions
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
update-charts:
name: Update chart files
runs-on: ubuntu-latest
env:
GNUPG_PASSPHARSE: ${{ secrets.RELEASES_GPG_PASSPHARSE }}
GNUPG_KEY_BASE64: ${{ secrets.RELEASES_GPG_KEY }}
GH_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_API_KEY }}
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
# Step 1: Checkout
- uses: actions/checkout@v2
with:
token: ${{ env.GH_TOKEN }}
# Step 2: Set up GPG commit signing and import
# our Software Release GPG keys.
- name: Set up GPG commit signing
id: commitSigningStuff
run: ./scripts/setup-ci
env:
RELEASES_GPG_PASSPHARSE: ${{ env.GNUPG_PASSPHARSE }}
RELEASES_GPG_KEY: ${{ env.GNUPG_KEY_BASE64 }}
# Step 3: Update chart
- name: Update chart
run: DEBUG=1 ./scripts/update-chart ${{ github.event.inputs.chartName }}
env:
RELEASES_GPG_PASSPHARSE: ${{ env.GNUPG_PASSPHARSE }}
# If failed, run this
- name: Notify people over Discord and Guilded for failed CI
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
webhook: |
${{ secrets.NOTIFICATIONS_DISCORD_WEBHOOK }}
${{ secrets.NOTIFICATIONS_GUILDED_WEBHOOK }}
status: ${{ job.status }}
title: "Helm Charts Updater had an problem while updating source files"
description: "Failed to update chart files for ${{ github.event.inputs.chartName }}. Please see the CI logs for details and if necessary, add, update or remove entries from the index directory."
nofail: false
nodetail: false
username: Github Actions
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
- name: Notify people over Discord and Guilded for successfully release
if: ${{ success() }}
uses: sarisia/actions-status-discord@v1
with:
webhook: |
${{ secrets.NOTIFICATIONS_DISCORD_WEBHOOK }}
${{ secrets.NOTIFICATIONS_GUILDED_WEBHOOK }}
status: ${{ job.status }}
title: "Helm Charts Updater sucessfully updated chart files for ${{ github.eveng.inputs.chartName }}"
description: "Updated charts file for ${{ github.event.inputs.chartName }} for Chart Releaser bot to be tagged and pushed to GitHub Pages."
nofail: false
nodetail: false
username: Github Actions
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png