This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (82 loc) · 2.71 KB
/
release-helm.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
name: Release
on:
push:
branches:
- main
jobs:
generate-version:
name: "Generate version"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.out.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk
- id: pr
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Match semver label via bash
id: match-label-bash
run: |
LABELS=$(cat <<-END
${{ steps.pr.outputs.labels }}
END
)
IFS='\n' read -ra LABEL <<< "$LABELS"
for i in "${LABEL[@]}"; do
case $i in
# Will just use the first occurence
'major'|'minor'|'patch')
echo "RELEASE_LABEL=$i" >> $GITHUB_OUTPUT
break
esac
done
- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.match-label-bash.outputs.RELEASE_LABEL }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION})"
deploy:
name: "Release charts"
needs:
- "generate-version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
run: |
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: true
git-release:
name: "Create Git Release"
needs: ["generate-version", "deploy"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ needs.generate-version.outputs.version }}
prerelease: false
title: ${{ needs.generate-version.outputs.version }}
files: |
LICENSE