-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parameter for Helm publish version (#195)
- Loading branch information
1 parent
81553c0
commit befee5a
Showing
2 changed files
with
12 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,11 @@ on: | |
required: false | ||
default: ".github/lint-config.yaml" | ||
type: string | ||
version: | ||
description: "Version for helm chart" | ||
required: false | ||
default: ${{ github.ref_name }} | ||
type: string | ||
|
||
secrets: | ||
github-username: | ||
|
@@ -56,27 +61,21 @@ jobs: | |
uses: bakdata/ci-templates/actions/[email protected] | ||
with: | ||
lint-config-path: "${{ inputs.lint-config-path }}" | ||
ref: ${{ github.ref_name }} | ||
|
||
update-version: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
singlechart: ${{ steps.step2.outputs.singlechart }} | ||
needs: [helm-lint] | ||
env: | ||
current-ref: ${{ github.ref_name }} | ||
CHARTS: ${{ inputs.subdirs }} | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: bakdata/ci-templates/actions/[email protected] | ||
with: | ||
ref: ${{ env.current-ref }} | ||
|
||
- name: Verify if have a single or multiple chart(s) | ||
id: step2 | ||
run: | | ||
charts="${{ env.CHARTS }}" | ||
charts="${{ inputs.subdirs }}" | ||
charts_without_brackets="${charts:1:-1}" | ||
charts_without_brackets_and_quotation="${charts_without_brackets//\'/}" | ||
|
@@ -94,38 +93,33 @@ jobs: | |
subdir: ${{ fromJson(inputs.subdirs) }} | ||
runs-on: ubuntu-22.04 | ||
needs: [update-version] | ||
env: | ||
charts-subdir: "${{ matrix.subdir }}" | ||
current-ref: ${{ github.ref_name }} | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: bakdata/ci-templates/actions/[email protected] | ||
with: | ||
ref: ${{ env.current-ref }} | ||
|
||
- name: Bump Chart version | ||
run: | | ||
sudo add-apt-repository ppa:rmescandon/yq | ||
sudo apt update | ||
sudo apt install yq -y | ||
yq e -i '.version = "${{ env.current-ref }}"' "./${{ env.charts-subdir }}/Chart.yaml" | ||
yq e -i '.version = "${{ inputs.version }}"' "./${{ matrix.subdir }}/Chart.yaml" | ||
shell: bash | ||
working-directory: ${{ inputs.charts-path }} | ||
|
||
- name: Prepare artifacts | ||
run: | | ||
mkdir -p ../${{ inputs.artifact-dir }}/${{ env.charts-subdir }} | ||
helm package ${{ env.charts-subdir }} -d ../${{ inputs.artifact-dir }}/${{ env.charts-subdir }} | ||
mkdir -p ../${{ inputs.artifact-dir }}/${{ matrix.subdir }} | ||
helm package ${{ matrix.subdir }} -d ../${{ inputs.artifact-dir }}/${{ matrix.subdir }} | ||
shell: bash | ||
working-directory: ${{ inputs.charts-path }} | ||
|
||
- name: Upload artifacts with action/upload as multi chart | ||
if: ${{ needs.update-version.outputs.singlechart == 'false' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.charts-subdir }} | ||
path: ${{ inputs.artifact-dir }}/${{ env.charts-subdir }} | ||
name: ${{ matrix.subdir }} | ||
path: ${{ inputs.artifact-dir }}/${{ matrix.subdir }} | ||
retention-days: 1 | ||
|
||
- name: Upload artifacts with action/upload as single chart | ||
|
@@ -138,9 +132,6 @@ jobs: | |
publish-artifacts: | ||
runs-on: ubuntu-22.04 | ||
needs: [package-new-artifacts, update-version] | ||
env: | ||
artifact-dir: "${{ inputs.artifact-dir }}" | ||
charts-path: "${{ inputs.artifact-dir }}" | ||
|
||
steps: | ||
- name: Check out branch containing the artifatcs and the index.yaml file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters