Skip to content

Commit

Permalink
WIP - .github workflows - CHARTS_DIR env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
itewk committed Jun 22, 2021
1 parent 80fdb25 commit f6dce65
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# --validate-chart-schema=false due to https://github.com/helm/chart-testing/pull/300

ct lint \
--chart-dirs charts/ploigos-workflow/ \
--chart-dirs ${CHARTS_DIR} \
--all \
--validate-maintainers=false
2 changes: 1 addition & 1 deletion .github/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

ct install \
--chart-dirs charts/ploigos-workflow/ \
--chart-dirs ${CHARTS_DIR} \
--all
15 changes: 9 additions & 6 deletions .github/workflows/publish-helm-charts-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- .github/**
- charts/**

env:
CHARTS_DIR='charts/ploigos-workflow'

jobs:
setup:
runs-on: ubuntu-latest
Expand All @@ -26,7 +29,7 @@ jobs:
- name: Determine Helm Charts to release ⚙️
id: helm-charts
run: |
HELM_CHARTS=$(python -c 'import os, json; print json.dumps(os.listdir("charts/ploigos-workflow"))')
HELM_CHARTS=$(python -c "import os, json; print json.dumps(os.listdir('${{ env.CHARTS_DIR }}'))")
echo "::set-output name=helm-charts::${HELM_CHARTS}"
lint:
Expand Down Expand Up @@ -106,7 +109,7 @@ jobs:
id: helm-chart-info
uses: jacobtomlinson/gha-read-helm-chart@0.1.2
with:
path: charts/ploigos-workflow/${{ matrix.helm-chart }}
path: ${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}

- name: Set up Python 🐍
uses: actions/setup-python@v2
Expand Down Expand Up @@ -193,12 +196,12 @@ jobs:
uses: docker://mikefarah/yq:3
with:
args:
yq write --inplace charts/${{ matrix.helm-chart }}/Chart.yaml version ${{ steps.helm-chart-next-semver.outputs.next-semver }}
yq write --inplace ${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.yaml version ${{ steps.helm-chart-next-semver.outputs.next-semver }}

# NOTE: workaround for https://github.com/helm/chart-releaser/issues/95
- name: Create Chart.lock ⚙️
run: |
helm dependency update charts/ploigos-workflow/${{ matrix.helm-chart }}
helm dependency update ${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}
# NOTE:
# Chart.lock uploaded as workaround for https://github.com/helm/chart-releaser/issues/95
Expand All @@ -207,8 +210,8 @@ jobs:
with:
name: ${{ matrix.helm-chart }}
path: |
charts/ploigos-workflow/${{ matrix.helm-chart }}/Chart.yaml
charts/ploigos-workflow/${{ matrix.helm-chart }}/Chart.lock
${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.yaml
${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.lock
release:
runs-on: ubuntu-latest
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/publish-helm-charts-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
types:
- published

env:
CHARTS_DIR='charts/ploigos-workflow'

jobs:
# NOTE:
# * currently no way to filter on release actions
Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
- name: Determine Helm Charts to release ⚙️
id: helm-charts
run: |
HELM_CHARTS=$(python -c 'import os, json; print json.dumps(os.listdir("charts/"))')
HELM_CHARTS=$(python -c "import os, json; print json.dumps(os.listdir('${{ env.CHARTS_DIR }}'))")
echo "::set-output name=helm-charts::${HELM_CHARTS}"
- name: Determine Helm Chart Version ⚙️
Expand Down Expand Up @@ -135,12 +138,12 @@ jobs:
uses: docker://mikefarah/yq:3
with:
args:
yq write --inplace charts/${{ matrix.helm-chart }}/Chart.yaml version ${{ needs.setup.outputs.helm-charts-new-semver }}
yq write --inplace ${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.yaml version ${{ needs.setup.outputs.helm-charts-new-semver }}

# NOTE: workaround for https://github.com/helm/chart-releaser/issues/95
- name: Create Chart.lock ⚙️
run: |
helm dependency update charts/${{ matrix.helm-chart }}
helm dependency update ${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}
# NOTE:
# Chart.lock uploaded as workaround for https://github.com/helm/chart-releaser/issues/95
Expand All @@ -149,8 +152,8 @@ jobs:
with:
name: ${{ matrix.helm-chart }}
path: |
charts/${{ matrix.helm-chart }}/Chart.yaml
charts/${{ matrix.helm-chart }}/Chart.lock
${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.yaml
${{ env.CHARTS_DIR }}/${{ matrix.helm-chart }}/Chart.lock
release:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- .github/**
- charts/**

env:
CHARTS_DIR='charts/ploigos-workflow'

jobs:
lint:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f6dce65

Please sign in to comment.