Skip to content

.github/workflows/release.yml #37

.github/workflows/release.yml

.github/workflows/release.yml #37

Workflow file for this run

on:
push:
tags:
- '**'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-22.04
container:
image: quay.io/helmpack/chart-releaser:v1.6.1
outputs:
version: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update FusionAuth app version in misc files
working-directory: ./chart
run: |
apk add -q curl jq
APP_VERSION=$(curl -s https://account.fusionauth.io/api/version | jq -r '.versions[]' | sort -V | tail -n 1)
echo "Chart: ${GITHUB_REF##*/}"
echo "App: $APP_VERSION"
sed -i 's/\(version: \).*/\1'"${GITHUB_REF##*/}"'/' Chart.yaml
sed -i 's/\(appVersion: \).*/\1'"$APP_VERSION"'/' Chart.yaml
sed -i 's/\(^ tag: \).*/\1'"$APP_VERSION"'/' values.yaml
sed -i 's/\(^ tag: \).*/\1'"$APP_VERSION"'/' examples/minikube/values.yaml
sed -i '/| image.tag/s/\"\([^]]*\)\"/\"'"$APP_VERSION"'\"/' README.md
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: configure git
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
git config --global --add safe.directory /__w/charts/charts
- name: commit new app version
run: |
git commit -am "Update FusionAuth app version in chart to ${{ env.APP_VERSION }}"
git push
# - name: Release
# id: release
# env:
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# CR_OWNER: fusionauth
# CR_GIT_REPO: charts
# CR_PACKAGE_PATH: .deploy
# CR_INDEX_PATH: index.yaml
# CR_PAGES_BRANCH: main
# CR_RELEASE_NAME_TEMPLATE: "{{ .Version }}"
# run: |
# cr package chart
# cr upload
# cr index --push
# ARCHIVE=$(ls ${CR_PACKAGE_PATH})
# echo "version=${ARCHIVE%.*}" >> "$GITHUB_OUTPUT"
# install:
# runs-on: ubuntu-22.04
# needs: release
# steps:
# - name: Set up helm
# uses: azure/setup-helm@v4
# - name: Set up kind
# uses: helm/kind-action@v1
# - name: Install the chart in kind
# env:
# CHARTS_REPO: https://fusionauth.github.io/charts
# run: |
# helm repo add fusionauth ${CHARTS_REPO}
# helm install fusionauth fusionauth/fusionauth \
# --set database.host=host \
# --set database.user=user \
# --set database.password=password \
# --set search.host=host
# - name: Verify the chart version
# env:
# RELEASED_VERSION: ${{ needs.release.outputs.version }}
# run: |
# INSTALLED_VERSION=$(helm list -m1 -f 'fusionauth*' -o json | jq -r '.[0].chart' )
# if [[ "${RELEASED_VERSION}" != "${INSTALLED_VERSION}" ]]; then
# echo "Incorrect Version Installed ..."
# echo "Released Version: ${RELEASED_VERSION}"
# echo "Installed Version: ${INSTALLED_VERSION}"
# exit 1
# else
# echo "Installed ${INSTALLED_VERSION} as expected."
# fi