@@ -13,6 +13,9 @@ inputs:
13
13
description : ' The directory containing multiple yamls for a Replicated release.'
14
14
required : true
15
15
default : ' manifests'
16
+ version :
17
+ description : ' Provides version to use for the Replicated Release'
18
+ reqired : false
16
19
kubernetes-distribution :
17
20
description : ' Kubernetes distribution of the cluster to provision.'
18
21
required : true
41
44
steps :
42
45
- name : Extract Chart YAML
43
46
id : extract-chart-yaml
47
+ if : inputs.version == ''
44
48
shell : bash
45
49
run : |
46
50
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
@@ -51,27 +55,36 @@ runs:
51
55
CHART_NAME : ${{ inputs.helm-chart-name }}
52
56
- name : Get Chart Version
53
57
id : get-chart-version
58
+ if : inputs.version == ''
54
59
uses : mikefarah/yq@master
55
60
with :
56
61
cmd : yq '.version' ${CHART_YAML}
57
62
- name : Define App Version
58
63
shell : bash
64
+ if : inputs.version == ''
59
65
run : echo "APP_VERSION=${CHART_VERSION}+${GITHUB_REF_NAME//[^a-zA-Z0-9]/}.${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV
60
66
env :
61
67
CHART_VERSION : ${{ steps.get-chart-version.outputs.result }}
68
+ - name : Use Explicit Version
69
+ shell : bash
70
+ if : inputs.version != ''
71
+ run : echo "APP_VERSION=${VERSION}" >> $GITHUB_ENV
72
+ env :
73
+ VERSION : ${{ inputs.version }}
62
74
- name : Define Channel Name
63
75
shell : bash
64
76
run : echo "CHANNEL_NAME=${{ github.ref_name }}-${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}-${{ inputs.kubernetes-distribution }}-${{ inputs.kubernetes-version }}" >> $GITHUB_ENV
65
77
- name : Update Chart YAML
66
78
id : update-chart-yaml
79
+ if : inputs.version == ''
67
80
uses : mikefarah/yq@master
68
81
with :
69
82
cmd : yq -i '.version = "${{ env.APP_VERSION }}"' ${CHART_YAML}
70
83
- name : Update Chart Version
71
84
id : update-chart-version
72
85
shell : bash
73
- if : ${{ inputs.installation-method == 'helm' }}
74
- run : |
86
+ if : inputs.installation-method == 'helm' && inputs.version == ''
87
+ run : |
75
88
# update the chart version to match the Replicated app version
76
89
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
77
90
mkdir -p /tmp/repack
81
94
rm ${tarball}
82
95
env :
83
96
YAML_DIR : ${{ inputs.yaml-dir }}
97
+ CHART_NAME : ${{ inputs.helm-chart-name }}
84
98
- name : ' Create Release'
85
99
id : ' create-release'
86
100
uses : replicatedhq/compatibility-actions/create-release@v0
0 commit comments