forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (67 loc) · 2.55 KB
/
k8s-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
# Copyright 2021 Vectorized, Inc.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.md
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0
name: k8s operator and helm release
on:
release:
types: [published]
jobs:
publish-k8s-operator-configurator-images:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Get tag name (if any)
run: echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Build and tag release images
working-directory: src/go/k8s/
shell: bash
run: |
make docker-build
make docker-build-configurator
make docker-tag-release
- name: Login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push release image to dockerhub
working-directory: src/go/k8s/
shell: bash
run: make docker-push-release
helm-release:
runs-on: ubuntu-20.04
container: quay.io/helmpack/chart-releaser:v1.2.0
steps:
- name: Install Git
run: apk update && apk upgrade && apk add --no-cache git
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.1
- name: Package helm chart
working-directory: src/go/k8s/helm-chart/charts
run: helm package --version ${{ github.event.release.tag_name }} --app-version ${{ github.event.release.tag_name }} redpanda-operator
- name: Upload helm package to release
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/go/k8s/helm-chart/charts/redpanda-operator-${{ github.event.release.tag_name }}.tgz
asset_name: redpanda-operator-${{ github.event.release.tag_name }}.tgz
tag: ${{ github.event.release.tag_name }}
- name: Update index
if: contains(github.event.release.tag_name, '-beta') == false
run: |
cr index -o vectorizedio -r redpanda -c https://charts.vectorized.io/ -i index.yaml -p src/go/k8s/helm-chart/charts -t ${{ secrets.GITHUB_TOKEN }} --push --release-name-template "{{ .Version }}"