Skip to content

Commit

Permalink
Allows for explicit version
Browse files Browse the repository at this point in the history
  • Loading branch information
crdant committed Jul 2, 2023
1 parent 4963477 commit 700ac60
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions smoke-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
description: 'The directory containing multiple yamls for a Replicated release.'
required: true
default: 'manifests'
version:
description: 'Provides version to use for the Replicated Release'
reqired: false
kubernetes-distribution:
description: 'Kubernetes distribution of the cluster to provision.'
required: true
Expand Down Expand Up @@ -41,6 +44,7 @@ runs:
steps:
- name: Extract Chart YAML
id: extract-chart-yaml
if: inputs.version == ''
shell: bash
run: |
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
Expand All @@ -51,27 +55,36 @@ runs:
CHART_NAME: ${{ inputs.helm-chart-name }}
- name: Get Chart Version
id: get-chart-version
if: inputs.version == ''
uses: mikefarah/yq@master
with:
cmd: yq '.version' ${CHART_YAML}
- name: Define App Version
shell: bash
if: inputs.version == ''
run: echo "APP_VERSION=${CHART_VERSION}+${GITHUB_REF_NAME//[^a-zA-Z0-9]/}.${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV
env:
CHART_VERSION: ${{ steps.get-chart-version.outputs.result }}
- name: Use Explicit Version
shell: bash
if: inputs.version != ''
run: echo "APP_VERSION=${VERSION}" >> $GITHUB_ENV
env:
VERSION: ${{ inputs.version }}
- name: Define Channel Name
shell: bash
run: echo "CHANNEL_NAME=${{ github.ref_name }}-${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}-${{ inputs.kubernetes-distribution }}-${{ inputs.kubernetes-version }}" >> $GITHUB_ENV
- name: Update Chart YAML
id: update-chart-yaml
if: inputs.version == ''
uses: mikefarah/yq@master
with:
cmd: yq -i '.version = "${{ env.APP_VERSION }}"' ${CHART_YAML}
- name: Update Chart Version
id: update-chart-version
shell: bash
if: ${{ inputs.installation-method == 'helm' }}
run: |
if: inputs.installation-method == 'helm' && inputs.version == ''
run: |
# update the chart version to match the Replicated app version
tarball=$(find ${YAML_DIR} -name "${CHART_NAME}*.tgz")
mkdir -p /tmp/repack
Expand All @@ -81,6 +94,7 @@ runs:
rm ${tarball}
env:
YAML_DIR: ${{ inputs.yaml-dir }}
CHART_NAME: ${{ inputs.helm-chart-name }}
- name: 'Create Release'
id: 'create-release'
uses: replicatedhq/compatibility-actions/create-release@v0
Expand Down

0 comments on commit 700ac60

Please sign in to comment.