Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Filter Helm Releases
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will want @nguyer's input on this. This assumes we might make separate GH releases for the chart itself, and so we needed a way to prevent the Docker image from being re-published if that was done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hayden and I chatted about this. I'm fine with this being in the GitHub Action for now, but I think I'd like to have further discussion about creating "Releases" in GitHub for the Helm chart. I'm not convinced that we want releases for multiple different things on the GitHub release page just yet.

run: |
echo "Detected that GitHub release is for the Helm chart... aborting this build as a result."
exit 1
if: startsWith(github.ref, 'refs/tags/helm-v')

- name: Build
run: |
docker build \
Expand All @@ -31,4 +37,4 @@ jobs:
if: github.event.action == 'released'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push ghcr.io/hyperledger/firefly:latest
docker push ghcr.io/hyperledger/firefly:latest
54 changes: 52 additions & 2 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
name: Helm

on:
push:
tags:
- "helm-v*"
branches:
- main
paths:
- "deploy/charts/**/*"
- ".github/workflows/helm.yml"
pull_request:
branches:
- main
paths:
- "deploy/charts/**/*"
- ".github/workflows/helm.yml"
jobs:
helm:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: setup helm
uses: azure/setup-helm@v1
with:
version: 3.6.0
version: 3.7.2

- name: setup chart-testing tool
uses: helm/chart-testing-action@v2.0.1
Expand Down Expand Up @@ -53,3 +62,44 @@ jobs:
if: ${{ failure() }}
run: |
kubectl get pod -A
release:
needs: test
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/helm-v') || github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: chart-version
run: |
CHART_VERSION=$(helm show chart deploy/charts/firefly | grep '^version:' | awk '{ printf("%s", $2) }')
echo "CHART_VERSION=${CHART_VERSION}" >> $GITHUB_ENV

- name: head-version
if: github.ref == 'refs/heads/main'
run: |
BUILD_TAG=${{ env.CHART_VERSION }}-$(date +"%Y%m%d")-$GITHUB_RUN_NUMBER
echo "PUBLISH_VERSION=${BUILD_TAG}" >> $GITHUB_ENV

- name: release-version
if: startsWith(github.ref, 'refs/tags/helm-v')
run: |
TAG_VERSION=$(echo -n "${GITHUB_REF##*/}" | sed 's/helm-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 }} ./deploy/charts/firefly
helm push firefly-${{ env.PUBLISH_VERSION }}.tgz oci://ghcr.io/hyperledger/helm
env:
HELM_EXPERIMENTAL_OCI: "1"
4 changes: 2 additions & 2 deletions deploy/charts/firefly/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: firefly
description: A Helm chart for deploying FireFly and FireFly HTTPS Dataexchange onto Kubernetes.
type: application
appVersion: "0.11.2"
version: "0.1.0"
appVersion: "0.11.4"
version: "0.0.1"

maintainers:
- name: hfuss
Expand Down
Loading