@@ -2,6 +2,15 @@ name: Chart Release
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ plane-ce :
7
+ description : ' Build Plane CE'
8
+ type : boolean
9
+ default : false
10
+ plane-ee :
11
+ description : ' Build Plane EE'
12
+ type : boolean
13
+ default : false
5
14
6
15
env :
7
16
CR_CONFIGFILE : " ${{ github.workspace }}/cr.yaml"
14
23
TARGET_BRANCH : " ${{ github.ref_name }}"
15
24
CHART_NAME_CE : " plane-ce"
16
25
CHART_NAME_ENTERPRISE : " plane-enterprise"
26
+ MARK_AS_LATEST : true
17
27
18
28
jobs :
19
29
setup :
30
+ if : ${{ github.event.inputs.plane-ce == 'true' || github.event.inputs.plane-ee == 'true' }}
20
31
runs-on : ubuntu-latest
21
32
permissions :
22
33
contents : write
@@ -60,12 +71,28 @@ jobs:
60
71
61
72
chmod 400 ${{env.GNUPGHOME}}/secring.gpg
62
73
74
+ - name : Remove unwanted charts
75
+ run : |
76
+ if [ "${{ github.event.inputs.plane-ce }}" = "false" ]; then
77
+ rm -rf charts/${{ env.CHART_NAME_CE }}
78
+ fi
79
+ if [ "${{ github.event.inputs.plane-ee }}" = "false" ]; then
80
+ rm -rf charts/${{ env.CHART_NAME_ENTERPRISE }}
81
+ fi
82
+
63
83
- name : Rename Chart
64
84
if : github.ref_name != 'master'
65
85
run : |
66
86
flatBranchName=$(echo "${{ env.TARGET_BRANCH }}" | sed 's/\//\-/g')
67
- sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_CE }}/Chart.yaml
68
- sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_ENTERPRISE }}/Chart.yaml
87
+ if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
88
+ sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_CE }}/Chart.yaml
89
+ fi
90
+
91
+ if [ "${{ github.event.inputs.plane-ee }}" = "true" ]; then
92
+ sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_ENTERPRISE }}/Chart.yaml
93
+ fi
94
+
95
+ echo "MARK_AS_LATEST=false" >> $GITHUB_ENV
69
96
70
97
- name : Release Charts
71
98
74
101
config : cr.yaml
75
102
packages_with_index : false
76
103
skip_existing : true
104
+ mark_as_latest : ${{ env.MARK_AS_LATEST }}
77
105
env :
78
106
CR_TOKEN : ${{ env.CR_TOKEN }}
79
107
CR_KEY : ${{ env.GPG_KEY_NAME }}
82
110
CR_SIGN : true
83
111
84
112
- id : publish-plane-enterprise
85
- if : github.ref_name == 'master'
113
+ if : ${{ github.ref_name == 'master' && github.event.inputs.plane-ee == 'true' }}
86
114
name : Harbor Publish Plane-Enterprise
87
115
env :
88
116
CHART_REPO : ${{ env.CHART_NAME_ENTERPRISE }}
@@ -125,14 +153,23 @@ jobs:
125
153
126
154
- name : Copy Readme
127
155
run : |
128
- cp code/charts/plane-ce/README.md pages/content/plane-ce.md
129
- cp code/charts/plane-enterprise/README.md pages/content/plane-ee.md
156
+ if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
157
+ cp code/charts/plane-ce/README.md pages/content/plane-ce.md
158
+ fi
159
+ if [ "${{ github.event.inputs.plane-ee }}" = "true" ]; then
160
+ cp code/charts/plane-enterprise/README.md pages/content/plane-ee.md
161
+ fi
130
162
131
163
- name : Publish pages
132
164
working-directory : pages
133
165
run : |
134
166
git add .
135
- git commit -m "Updated READMEs"
136
- git push
137
-
167
+ if git diff-index --quiet HEAD --; then
168
+ echo "No changes to commit"
169
+ else
170
+ # Commit and push the changes
171
+ git commit -m "Updated READMEs"
172
+ git push
173
+ fi
174
+
138
175
0 commit comments