Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/z_release_major.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ If all is good, then in 24h, I will start the release. Thanks!
- [ ] Ensure that the release notes PR is merged before moving to next step.
- [ ] Create a [new release](https://github.com/medic/cht-core/releases/new) in GitHub, with the naming convention `<major>.<minor>.<patch>`, from the release branch created above as the target branch. Click on the "Choose a tag" dropdown and create a tag for the release with the naming convention `<major>.<minor>.<patch>`. Add a link to the release notes in the description of the release.
- [ ] Once you publish the release, confirm the release build completes successfully and the new release is available on the [market](https://staging.dev.medicmobile.org/_couch/builds_4/_design/builds/_view/releases). Make sure that the document has new entry with `id: medic:medic:<major>.<minor>.<patch>`
- [ ] Run the [helm chart build script](https://github.com/medic/cht-core/blob/master/scripts/build/helm/package-chart.sh) (eg `./package-chart.sh 5.3.0`), commit the new chart and merge the PR so it will be in the release.
- [ ] Upgrade the [demo](https://demo-cht.dev.medicmobile.org/) instance to the newly released version.
- [ ] From the "App Management" admin console (`medic` user creds in 1Password), go to "Upgrades" and stage the upgrade for this version.
- [ ] Clone `cht-core` repo and checkout the target tag (`git checkout <major>.<minor>.x` ) to ensure you have the proper version of the helm charts.
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/z_release_patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Once all issues have been merged into `master` then the release process can star
- [ ] Ensure that the release notes PR is merged before moving to next step.
- [ ] Create a [new release](https://github.com/medic/cht-core/releases/new) in GitHub, with the naming convention `<major>.<minor>.<patch>`, from the release branch created above as the target branch. Click on the "Choose a tag" dropdown and create a tag for the release with the naming convention `<major>.<minor>.<patch>`. Add a link to the release notes page in the description of the release.
- [ ] Once you publish the release, confirm the release build completes successfully and the new release is available on the [market](https://staging.dev.medicmobile.org/_couch/builds_4/_design/builds/_view/releases). Make sure that the document has new entry with `id: medic:medic:<major>.<minor>.<patch>`
- [ ] Run the [helm chart build script](https://github.com/medic/cht-core/blob/master/scripts/build/helm/package-chart.sh) (eg `./package-chart.sh 5.3.0`), commit the new chart and merge the PR so it will be in the release.
- [ ] Upgrade the [demo](https://demo-cht.dev.medicmobile.org/) instance to the newly released version.
- [ ] From the "App Management" admin console (`medic` user creds in 1Password), go to "Upgrades" and stage the upgrade for this version.
- [ ] Clone `cht-core` repo and checkout the target tag (`git checkout <major>.<minor>.x` ) to ensure you have the proper version of the helm charts.
Expand Down
89 changes: 37 additions & 52 deletions .github/workflows/release-helm-charts.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,53 @@
name: Release Helm Charts
name: Push Helm Charts→Docs Site

on:

# CHT Core only pushes new tags when we do a release
push:
tags:
- 'v*'

permissions:
contents: write # Required to attach files to GitHub releases
- '*'
# allow this to be run manually in case a change is made outside
# of a release
workflow_dispatch:

jobs:
package-helm-charts:
name: Package Helm Charts
checkout-repo-upload-chart-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 30

permissions:
contents: read
pages: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Checkout CHT Core Repo 🛎️
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Check warning

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Warning

credential persistence through GitHub Actions artifacts

- name: Setup Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
- name: Setup Pages ⚙️
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 # zizmor: ignore[cache-poisoning]
- name: Upload artifact 📡
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
node-version: '22.15'

- name: Install dependencies
run: npm ci

- name: Generate Helm Chart
working-directory: scripts/build/helm
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/}"
TAG_VERSION="${TAG_VERSION#v}"
sed -i "s/version: .*/version: $TAG_VERSION/" Chart.yaml
sed -i "s/appVersion: .*/appVersion: \"$TAG_VERSION\"/" Chart.yaml
sed -i "s/{{cht_version}}/$TAG_VERSION/g" values/base.yaml
sed -i "s/{{cht_image_tag}}/$TAG_VERSION/g" values/base.yaml
# Upload just helm charts
path: './scripts/build/helm-releases'

- name: Package Helm Chart
working-directory: scripts/build/helm
run: |
mkdir -p ../../helm-packages
helm package . --destination ../../helm-packages
ls -la ../../helm-packages/
copy-artifacts-to-gh-pages:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: checkout-repo-upload-chart-artifacts
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

- name: Create Release Assets
run: |
mkdir -p release-assets
cp helm-packages/*.tgz release-assets/
ls -la release-assets/
permissions:
contents: read
pages: write
id-token: write

- name: Upload Release Assets
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: helm-charts-${{ github.ref_name }}
path: release-assets/
retention-days: 30

- name: Attach Helm Chart to Release
run: gh release upload "$TAG_NAME" release-assets/* --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
steps:
- name: Publish to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
Binary file added scripts/build/helm-releases/cht-chart-5.0.0.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.0.1.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.0.2.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.0.3.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.1.0.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.1.1.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.1.2.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.1.3.tgz
Binary file not shown.
Binary file added scripts/build/helm-releases/cht-chart-5.2.0.tgz
Binary file not shown.
27 changes: 27 additions & 0 deletions scripts/build/helm-releases/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="CHT Core helm charts">
<title>CHT Core helm charts</title>
</head>
<body>

<header>
<h1>CHT Core Helm Charts</h1>
</header>

<main>
<p>Helm charts for <a href="https://github.com/medic/cht-core/">CHT Core</a> - see raw <a href="./index.yaml">index.yaml</a>. </p>
</main>

<footer>
<p>©<span id="currentYear">2026</span> Medic. All rights reserved.</p>
</footer>

<script>
document.getElementById('currentYear').textContent = new Date().getFullYear();
</script>
</body>
</html>
112 changes: 112 additions & 0 deletions scripts/build/helm-releases/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
apiVersion: v1
entries:
cht-chart:
- apiVersion: v2
appVersion: 5.2.0
created: "2026-07-31T17:08:56.734589348-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 29cc300af392aaafeebe7283143d1691b65cad5e7fd77fce5d024ca27f7933ca
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.2.0.tgz
version: 5.2.0
- apiVersion: v2
appVersion: 5.1.3
created: "2026-07-31T17:08:56.734034065-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: faa0e80c7928cf27267fdaec297876a1662fe4003e4eea6d8a5cafd0d1d2838c
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.1.3.tgz
version: 5.1.3
- apiVersion: v2
appVersion: 5.1.2
created: "2026-07-31T17:08:56.733466649-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: b77d76546317ae38d7ab67e577a7b96979712fe9d0477aa12e0d317c28af50e7
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.1.2.tgz
version: 5.1.2
- apiVersion: v2
appVersion: 5.1.1
created: "2026-07-31T17:08:56.732918319-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 530ad0df2b60883e27809351315357ca2632dca851d6ea563a70aae1f072932b
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.1.1.tgz
version: 5.1.1
- apiVersion: v2
appVersion: 5.1.0
created: "2026-07-31T17:08:56.732401559-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 0c13fea85b63bc12acdae0a748614cdc85fcbf4443cd315a233631eca36799dd
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.1.0.tgz
version: 5.1.0
- apiVersion: v2
appVersion: 5.0.3
created: "2026-07-31T17:08:56.731877675-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 42ff2e79f973534b61c94c429ea46db3aed301e53d9381c576f366ea2385366f
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.0.3.tgz
version: 5.0.3
- apiVersion: v2
appVersion: 5.0.2
created: "2026-07-31T17:08:56.731363659-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 9a621035c86b7d13165d28bfb86b938970c3f403fbce5f6ff38b6450e1d89117
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.0.2.tgz
version: 5.0.2
- apiVersion: v2
appVersion: 5.0.1
created: "2026-07-31T17:08:56.730810109-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: df66d4253cec378b3b1094ff707db78df362c7bd730be4bb3165080a5753ee91
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.0.1.tgz
version: 5.0.1
- apiVersion: v2
appVersion: 5.0.0
created: "2026-07-31T17:08:56.730224269-07:00"
description: A Helm chart for Community Health Toolkit (CHT)
digest: 2156cddcd51797f78a6034c23993ed59d4089233482c08b74ae45da4e9016e29
home: https://github.com/medic/cht-core
icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4
name: cht-chart
type: application
urls:
- https://helm.app.medicmobile.org/cht-core/cht-chart-5.0.0.tgz
version: 5.0.0
generated: "2026-07-31T17:08:56.727833077-07:00"
62 changes: 62 additions & 0 deletions scripts/build/helm/package-chart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

set -eu -o pipefail

# set CHT version from argument
TAG_VERSION=$1

# check to make sure it's at least X.Y.Z format
if ! [[ "$TAG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version \"$TAG_VERSION\" isn't SemVer, exiting"
exit 1
fi

# prompt user if they're ready to continue
echo "
Do you want to package helm chart for version ${TAG_VERSION} of the CHT?

You must have release candidate branch for ${TAG_VERSION} checked out already! (y/N)"
read -r -p " " yn
case "${yn}" in
[yY] ) ;;
*) echo "aborted"; exit 1 ;;
esac

# update placeholder values in files
sed -i "s/ (CHT) v4/ (CHT)/" Chart.yaml
sed -i "s/version: .*/version: $TAG_VERSION/" Chart.yaml
sed -i "s/appVersion: .*/appVersion: \"$TAG_VERSION\"/" Chart.yaml
sed -i "s/{{cht_version}}/$TAG_VERSION/g" values/base.yaml
sed -i "s/{{cht_image_tag}}/$TAG_VERSION/g" values/base.yaml

./validate-templates.sh

# lint the chart before publishing
# disabling for now as this throws an error, but maybe that's expected with
# our place holder values? The old helm chart repo did this OK:
# [INFO] values.yaml: file does not exist
#[ERROR] templates/: cht-chart/templates/sentinel/deployment.yaml:29:28
# executing "cht-chart/templates/sentinel/deployment.yaml" at <.Values.upstream_servers.docker_registry>:
# nil pointer evaluating interface {}.docker_registry
#
#Error: 1 chart(s) linted, 1 chart(s) failed
#helm lint .

# package version, merge with existing index.yaml
helm package . -d ../helm-releases

# do this only first time
if [ ! -f ../helm-releases/index.yaml ]; then

Check failure on line 49 in scripts/build/helm/package-chart.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use '[[' instead of '[' for conditional tests. The '[[' construct is safer and more feature-rich.

See more on https://sonarcloud.io/project/issues?id=medic_cht-core&issues=AZ-71VGeP1NBD9Gnto6g&open=AZ-71VGeP1NBD9Gnto6g&pullRequest=11310
helm repo index ../helm-releases --url https://helm.app.medicmobile.org/cht-core
else
helm repo index ../helm-releases --merge ../helm-releases/index.yaml --url https://helm.app.medicmobile.org/cht-core
fi

# reset files for the next time we run this script
git checkout values/base.yaml Chart.yaml

echo "

Helm charts have been built. Commit these changes, submit a PR and
push the new charts to the CHT Core Repo.
"
Loading