-
Notifications
You must be signed in to change notification settings - Fork 93
100 lines (89 loc) · 2.86 KB
/
main.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
name: Release Charts
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:
inputs:
target:
description: "target chart to release"
type: string
default: ""
required: false
dryrun:
description: "dry-run"
type: boolean
default: true
required: false
backport-branch:
description: "Branch or leave empty for current CI branch"
type: string
default: ""
required: false
jobs:
build:
runs-on: ubuntu-latest
env:
BACKPORT_BRANCH: ${{ github.event.inputs.backport-branch || '' }}
BACKPORT_DIR: 'backport'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: current
- name: Checkout Backport branch
uses: actions/checkout@v4
if: github.event.inputs.backport-branch != ''
with:
ref: ${{ env.BACKPORT_BRANCH }}
path: ${{ env.BACKPORT_DIR }}
- name: Configure Git
run: |
cd current
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Configure Git for backport
if: github.event.inputs.backport-branch != ''
run: |
cd ${{ env.BACKPORT_DIR }}
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.13.1
- name: Add Helm repos
run: |
helm repo add mongodb https://mongodb.github.io/helm-charts
- name: Allow script
run: |
chmod +x ./current/.github/actions/releaser/cr.sh
- name: Helm Chart Dependency Releaser
uses: ./current/.github/actions/releaser
if: github.event.inputs.target == ''
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_repo_url: https://mongodb.github.io/helm-charts
target: |
atlas-operator-crds
community-operator-crds
dryrun: ${{ github.event.inputs.dryrun }}
work_dir: current
- name: Get latest charts from repo
run: |
helm repo update
- name: Helm Chart Releaser
uses: ./current/.github/actions/releaser
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
WORK_DIR: ${{ github.event.inputs.backport-branch == '' && 'current' || env.BACKPORT_DIR }}
MARK_LATEST: ${{ github.event.inputs.backport-branch == '' && 'true' || 'false' }}
with:
charts_repo_url: https://mongodb.github.io/helm-charts
target: ${{ github.event.inputs.target }}
dryrun: ${{ github.event.inputs.dryrun }}
work_dir: ${{ env.WORK_DIR }}
mark_latest: ${{ env.MARK_LATEST }}