-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (120 loc) · 4.5 KB
/
releasedr.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
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: Create chart Datarepo chart
on:
workflow_dispatch:
inputs:
notify-slack:
default: true
type: boolean
workflow_call:
inputs:
notify-slack:
default: false
type: boolean
push:
branches:
- master
paths:
- '!charts/**'
- '!.github/**'
- '!README.md'
- 'charts/datarepo-api/**'
- 'charts/datarepo-ui/**'
- 'charts/create-secret-manager-secret/**'
- 'charts/gcloud-sqlproxy/**'
- 'charts/oidc-proxy/**'
- 'charts/gcp-managed-cert/**'
- 'charts/de-elasticsearch/**'
jobs:
release_new_umbrella_dr:
runs-on: ubuntu-latest
outputs:
new-version: ${{ steps.new-chart.outputs.version }}
parent-chart-version: ${{ steps.parent-chart.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: true
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
token: "${{ secrets.BROADBOT_TOKEN }}" #otherwise merge will fail
ref: master
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: add repo
run: |
helm repo add datarepo-helm https://broadinstitute.github.io/datarepo-helm
helm repo add stable https://charts.helm.sh/stable
helm repo add elastic https://helm.elastic.co
helm repo add terra-helm https://terra-helm.storage.googleapis.com
helm repo update
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: "true"
- name: Pause between chart release and creation of new umbrella chart
id: wait
run: |
sleep 30
- name: "Get current umbrella chart version"
id: parent-chart
uses: mikefarah/[email protected]
with:
cmd: echo "version=$(yq '.version' charts/datarepo/Chart.yaml)" >> $GITHUB_OUTPUT
- name: "Create new umbrella chart"
uses: broadinstitute/[email protected]
# This step expects the previous datarepo-umbrella-release-action to
# edit the code downloaded in Checkout step on the runner filesystem
# and bump the umbrella chart version. So while parent-step code is identical
# new-chart will resolve to an updated chart version.
- name: "Get new umbrella chart version"
id: new-chart
uses: mikefarah/[email protected]
with:
cmd: echo "version=$(yq '.version' charts/datarepo/Chart.yaml)" >> $GITHUB_OUTPUT
- name: "[datarepo-helm] Merge in changes to umbrella chart"
uses: broadinstitute/datarepo-actions/actions/[email protected]
env:
COMMIT_MESSAGE: "Datarepo umbrella chart update"
GITHUB_REPO: datarepo-helm
MERGE_BRANCH: master
- name: "Notify Slack"
if: ${{ (github.event_name == 'push' && always()) || (inputs.notify-slack && always()) }} # workflow_call has own slack notification
uses: broadinstitute/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }} # required to work with job field
with:
status: ${{ job.status }}
fields: job,repo,message
channel: "#jade-spam"
username: "datarepo-helm actions"
text: "Create Datarepo Chart"
report-chart-to-sherlock:
name: Report Chart Version to DevOps
needs: [release_new_umbrella_dr]
uses: broadinstitute/sherlock/.github/workflows/client-report-chart-version.yaml@main
with:
new-version: ${{ needs.release_new_umbrella_dr.outputs.new-version }}
parent-chart-version: ${{ needs.release_new_umbrella_dr.outputs.parent-chart-version }}
chart-name: datarepo
permissions:
contents: read
id-token: write
set-chart-version-in-dev:
name: Set Chart Version in Dev
uses: broadinstitute/sherlock/.github/workflows/client-set-environment-chart-version.yaml@main
needs:
- release_new_umbrella_dr
- report-chart-to-sherlock
with:
new-version: ${{ needs.release_new_umbrella_dr.outputs.new-version }}
chart-name: datarepo
environment-name: dev
secrets:
sync-git-token: ${{ secrets.BROADBOT_TOKEN }}
permissions:
id-token: write