Skip to content

Commit 700ac60

Browse files
committed
Allows for explicit version
1 parent 4963477 commit 700ac60

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

smoke-test/action.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ inputs:
1313
description: 'The directory containing multiple yamls for a Replicated release.'
1414
required: true
1515
default: 'manifests'
16+
version:
17+
description: 'Provides version to use for the Replicated Release'
18+
reqired: false
1619
kubernetes-distribution:
1720
description: 'Kubernetes distribution of the cluster to provision.'
1821
required: true
@@ -41,6 +44,7 @@ runs:
4144
steps:
4245
- name: Extract Chart YAML
4346
id: extract-chart-yaml
47+
if: inputs.version == ''
4448
shell: bash
4549
run: |
4650
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
@@ -51,27 +55,36 @@ runs:
5155
CHART_NAME: ${{ inputs.helm-chart-name }}
5256
- name: Get Chart Version
5357
id: get-chart-version
58+
if: inputs.version == ''
5459
uses: mikefarah/yq@master
5560
with:
5661
cmd: yq '.version' ${CHART_YAML}
5762
- name: Define App Version
5863
shell: bash
64+
if: inputs.version == ''
5965
run: echo "APP_VERSION=${CHART_VERSION}+${GITHUB_REF_NAME//[^a-zA-Z0-9]/}.${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV
6066
env:
6167
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 }}
6274
- name: Define Channel Name
6375
shell: bash
6476
run: echo "CHANNEL_NAME=${{ github.ref_name }}-${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}-${{ inputs.kubernetes-distribution }}-${{ inputs.kubernetes-version }}" >> $GITHUB_ENV
6577
- name: Update Chart YAML
6678
id: update-chart-yaml
79+
if: inputs.version == ''
6780
uses: mikefarah/yq@master
6881
with:
6982
cmd: yq -i '.version = "${{ env.APP_VERSION }}"' ${CHART_YAML}
7083
- name: Update Chart Version
7184
id: update-chart-version
7285
shell: bash
73-
if: ${{ inputs.installation-method == 'helm' }}
74-
run: |
86+
if: inputs.installation-method == 'helm' && inputs.version == ''
87+
run: |
7588
# update the chart version to match the Replicated app version
7689
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
7790
mkdir -p /tmp/repack
@@ -81,6 +94,7 @@ runs:
8194
rm ${tarball}
8295
env:
8396
YAML_DIR: ${{ inputs.yaml-dir }}
97+
CHART_NAME: ${{ inputs.helm-chart-name }}
8498
- name: 'Create Release'
8599
id: 'create-release'
86100
uses: replicatedhq/compatibility-actions/create-release@v0

0 commit comments

Comments
 (0)