-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
117 lines (106 loc) · 3.51 KB
/
helm-chart-release.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
name: Release Charts
concurrency:
group: ${{ github.workflow }}
on:
push:
branches:
- trunk
paths:
- 'charts/selenium-grid/Chart.yaml'
workflow_dispatch:
inputs:
release:
description: 'Deploy a new release'
required: false
type: string
default: 'false'
skip-test:
description: 'Skip the tests'
required: false
type: boolean
default: false
skip-commit:
description: 'Skip the commit'
required: false
type: boolean
default: false
permissions: write-all
jobs:
helm-chart-test:
if: github.event.inputs.skip-test != 'true'
uses: ./.github/workflows/helm-chart-test.yml
with:
release: ${{ github.event.inputs.release == 'true' }}
release:
needs:
- helm-chart-test
if: (!failure() && !cancelled())
runs-on: ubuntu-latest
permissions: write-all
env:
NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
steps:
- name: Checkout
uses: actions/checkout@main
with:
persist-credentials: false
fetch-depth: 0
- name: Set up environment for building chart
uses: nick-invision/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: make setup_dev_env
- name: Build Helm chart
uses: nick-invision/retry@master
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 10
command: |
SET_VERSION=false make chart_build
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Get chart release notes (chart_release_notes.md)
run: |
./generate_chart_changelog.sh
echo "IS_RELEASE=$(cat /tmp/selenium_chart_release)" >> $GITHUB_ENV
- name: Login Docker Hub
run: helm registry login registry-1.docker.io -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
- name: Push Helm chart to registry
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 120
command: |
make chart_release
echo "LATEST_CHART_VERSION=$(cat /tmp/latest_chart_version)" >> $GITHUB_ENV
- name: Run chart-releaser
if: env.IS_RELEASE == 'true'
uses: helm/chart-releaser-action@main
with:
mark_as_latest: false
skip_existing: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NOTES_FILE: RELEASE_NOTES.md
- name: Commit files
if: github.event.inputs.skip-commit != 'true'
run: |
git config --local user.email "selenium-ci@users.noreply.github.com"
git config --local user.name "Selenium CI Bot"
git commit -m "Update chart ${LATEST_CHART_VERSION} changelog [skip ci]" -a || true
- name: Push changes
if: github.event.inputs.skip-commit != 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SELENIUM_CI_TOKEN || secrets.GITHUB_TOKEN }}
branch: trunk