Skip to content

Merge pull request #75 from alex-semenyuk/fix_links #205

Merge pull request #75 from alex-semenyuk/fix_links

Merge pull request #75 from alex-semenyuk/fix_links #205

Workflow file for this run

name: Helm Charts CI
on:
release:
types: [ released, prereleased ]
push:
branches:
- main
paths:
- "charts/**/*"
- ".github/workflows/helm.yml"
- "Makefile"
pull_request:
branches:
- main
paths:
- "charts/**/*"
- ".github/workflows/helm.yml"
- "Makefile"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup helm
uses: azure/setup-helm@v1
with:
version: 3.7.2
- name: setup chart-testing tool
uses: helm/chart-testing-action@v2.2.0
- name: lint charts
run: make lint
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.20.0
- name: install k8s deps
run: make deps
# - name: run chart integration test
# run: make test
- name: debug k8s
if: ${{ failure() }}
run: |
kubectl get pod -A
release:
needs: test
if: github.event_name == 'push' || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: chart-version
run: |
CHART_VERSION=$(helm show chart charts/firefly | grep '^version:' | awk '{ printf("%s", $2) }')
echo "CHART_VERSION=${CHART_VERSION}" >> $GITHUB_ENV
- name: head-version
if: github.event_name == 'push'
run: |
BUILD_TAG=${{ env.CHART_VERSION }}-$(date +"%Y%m%d")-$GITHUB_RUN_NUMBER
echo "PUBLISH_VERSION=${BUILD_TAG}" >> $GITHUB_ENV
- name: release-version
if: github.event_name == 'release'
run: |
# chop off the 'v' preceeding the semver in the git tag
TAG_VERSION=$(echo -n "${GITHUB_REF##*/}" | sed 's/v//g')
if [[ "$TAG_VERSION" != "${{ env.CHART_VERSION }}" ]]; then
echo "Release tag version [$TAG_VERSION] does not match the chart's version [${{ env.CHART_VERSION }}]"
exit 1
fi
echo "PUBLISH_VERSION=${{ env.CHART_VERSION }}" >> $GITHUB_ENV
- name: setup helm
uses: azure/setup-helm@v1
with:
version: 3.7.2
- name: helm publish
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u $GITHUB_ACTOR --password-stdin
helm package --version ${{ env.PUBLISH_VERSION }} ./charts/firefly-evmconnect
helm push firefly-evmconnect-${{ env.PUBLISH_VERSION }}.tgz oci://ghcr.io/hyperledger/helm
helm dep up ./charts/firefly
helm package --version ${{ env.PUBLISH_VERSION }} ./charts/firefly
helm push firefly-${{ env.PUBLISH_VERSION }}.tgz oci://ghcr.io/hyperledger/helm
env:
HELM_EXPERIMENTAL_OCI: "1"