-
Notifications
You must be signed in to change notification settings - Fork 93
86 lines (76 loc) · 2.39 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
name: Release Charts
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:
inputs:
backport-branch:
description: "Select backport branch if different from 'main'"
type: string
default: "main"
required: true
target:
description: "target chart to release"
type: string
default: ""
required: false
dryrun:
description: "not actually release, but check what would be done"
type: boolean
default: true
required: false
jobs:
build:
runs-on: ubuntu-latest
env:
BACKPORT_BRANCH: ${{ github.event.inputs.backport-branch || 'main' }}
CHARTS_DIR: ${{ github.event.inputs.backport-branch == 'main' && 'charts' || 'backports-checkout/charts' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout Backport branch
uses: actions/checkout@v4
if: github.event.inputs.backport-branch != 'main'
with:
ref: ${{ env.BACKPORT_BRANCH }}
path: backport-checkout
- name: Configure Git
run: |
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 ./.github/actions/releaser/cr.sh
- name: Helm Chart Dependency Releaser
uses: ./.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 }}
- name: Get latest charts from repo
run: |
helm repo update
- name: Helm Chart Releaser
uses: ./.github/actions/releaser
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_repo_url: https://mongodb.github.io/helm-charts
target: ${{ github.event.inputs.target }}
dryrun: ${{ github.event.inputs.dryrun }}
charts_dir: ${{ env.CHARTS_DIR }}