-
Notifications
You must be signed in to change notification settings - Fork 302
134 lines (122 loc) · 4.11 KB
/
release.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
134
name: Release
on:
push:
tags:
- "v*"
env:
HELM_REP: helm-charts
GH_OWNER: komodorio
CHART_DIR: charts/helm-dashboard
jobs:
pre_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get tag name
id: get_tag_name
run: echo "TAG_NAME=$(echo ${{ github.ref_name }} | cut -d 'v' -f2)" >> $GITHUB_OUTPUT
outputs:
release_tag: ${{ steps.get_tag_name.outputs.TAG_NAME }}
release:
needs: pre_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Node part
- name: Setup Node.js environment
uses: actions/[email protected]
with:
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: NPM install
run: npm i
working-directory: ./frontend
- name: NPM build
run: npm run build
working-directory: ./frontend
# Golang part
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: git cleanup
run: git clean -f && git checkout frontend/yarn.lock
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "1.18.2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test Binary Versions
run: "dist/helm-dashboard_linux_amd64_v1/helm-dashboard --help"
image:
runs-on: ubuntu-latest
needs: [ release, pre_release ]
timeout-minutes: 60
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
uses: docker/metadata-action@v3
id: meta
with:
images: komodorio/helm-dashboard
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build and push
uses: docker/build-push-action@v4
if: github.event_name != 'pull_request'
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: komodorio/helm-dashboard:${{ needs.pre_release.outputs.release_tag }},komodorio/helm-dashboard:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=${{ needs.pre_release.outputs.release_tag }}
platforms: linux/amd64,linux/arm64
publish_chart:
runs-on: ubuntu-latest
needs: [ image, pre_release ]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Bump versions
run: |
git config user.email [email protected]
git config user.name komodor-bot
git fetch --tags
git checkout main
sh ./ci/bump-versions.sh
git add charts/helm-dashboard/Chart.yaml
git add plugin.yaml
git commit -m "Increment chart versions [skip ci]" || echo "Already up-to-date"
git push -f || echo "Nothing to push!"
env:
APP_VERSION: ${{ needs.pre_release.outputs.release_tag }}
- name: Push folder to helm-charts repository
uses: crykn/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.KOMI_WORKFLOW_TOKEN }}
with:
source_folder: "charts/helm-dashboard"
destination_repo: "komodorio/helm-charts"
destination_folder: "charts/helm-dashboard"
user_email: "[email protected]"
user_name: "komodor-bot"
destination_branch: "master"
commit_msg: "feat(OSS helm-dashboard): ${{ github.event.head_commit.message }}" #important!! don't change this commit message unless you change the condition in pipeline.yml on helm-charts repo