Update things to prepare for 1.4.0 release (#1895) #26
Workflow file for this run
This file contains hidden or 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
| name: Helm Chart Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| # Sometimes chart-releaser might fetch an outdated index.yaml from gh-pages, causing a WAW hazard on the repo | |
| # This job checks the remote file is up to date with the local one on release | |
| validate-chart-index: | |
| name: Validate Chart Index | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'bcgov' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: gh-pages | |
| - name: Download remote index file and check equality | |
| run: | | |
| curl -vsSL https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/index.yaml > index.yaml.remote | |
| LOCAL="$(md5sum < index.yaml)" | |
| REMOTE="$(md5sum < index.yaml.remote)" | |
| echo "$LOCAL" = "$REMOTE" | |
| test "$LOCAL" = "$REMOTE" | |
| chart-release: | |
| name: Create and Publish Chart Release | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'bcgov' | |
| needs: [ validate-chart-index ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Add repositories | |
| run: | | |
| helm repo add bitnami https://charts.bitnami.com/bitnami | |
| helm repo add owf https://openwallet-foundation.github.io/helm-charts/ | |
| - name: Release workload charts | |
| uses: ./.github/actions/chart_releaser | |
| with: | |
| config: .github/cr.yaml | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| update-configs-and-sync: | |
| runs-on: ubuntu-latest | |
| name: Update Configs and Sync | |
| needs: | |
| - chart-release | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Checkout services directory from the trust-over-ip-configurations repo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: bcgov/trust-over-ip-configurations | |
| ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }} | |
| sparse-checkout: | | |
| services | |
| path: trust-over-ip-configurations | |
| - name: Lookup latest chart | |
| id: chart_version | |
| run: | | |
| helm repo add traction https://bcgov.github.io/traction | |
| helm repo update | |
| echo "APP_VERSION=$(helm search repo traction -ojson | jq '.[0].app_version')" >> $GITHUB_OUTPUT | |
| echo "CHART_VERSION=$(helm search repo traction -ojson | jq '.[0].version')" >> $GITHUB_OUTPUT | |
| - name: Update test | |
| env: | |
| APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} | |
| CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} | |
| run: | | |
| cd trust-over-ip-configurations | |
| yq e -i '.appVersion = env(APP_VERSION)' services/traction/charts/test/Chart.yaml | |
| yq e -i '.version = env(CHART_VERSION)' services/traction/charts/test/Chart.yaml | |
| yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/traction/charts/test/Chart.yaml | |
| - name: Update prod | |
| env: | |
| APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} | |
| CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} | |
| run: | | |
| cd trust-over-ip-configurations | |
| yq e -i '.appVersion = env(APP_VERSION)' services/traction/charts/prod/Chart.yaml | |
| yq e -i '.version = env(CHART_VERSION)' services/traction/charts/prod/Chart.yaml | |
| yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/traction/charts/prod/Chart.yaml | |
| - name: Commit and Push to trust-over-ip-configurations Repo | |
| run: | | |
| cd trust-over-ip-configurations | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add services/traction/charts/test/Chart.yaml services/traction/charts/prod/Chart.yaml | |
| git commit -m "Update chart and app versions" || echo "No changes to commit" | |
| git push origin main |