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
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,28 @@ runs:
echo "CHART_VERSION=$version" >> "$GITHUB_OUTPUT"
echo "ARTIFACT=ld-relay-$version.tgz" >> "$GITHUB_OUTPUT"

- name: Make build directory
shell: bash
run: mkdir -p build

- name: Package the helm chart
shell: bash
run: |
mkdir -p new-chart
helm package -d new-chart .
run: helm package -d build .

- name: Generate updated index.yaml
shell: bash
run: helm repo index new-chart --url https://launchdarkly.github.io/ld-relay-helm --merge helm-repo/index.yaml
run: helm repo index build --url https://launchdarkly.github.io/ld-relay-helm --merge helm-repo/index.yaml

- name: Move files into publishable directory
shell: bash
run: mv new-chart/${{ steps.version.outputs.ARTIFACT }} new-chart/index.yaml helm-repo
run: mv helm-repo/*tgz new-chart/
run: mv build/${{ steps.version.outputs.ARTIFACT }} build/index.yaml helm-repo
run: mv helm-repo/*tgz build/

- name: Publish to GitHub pages
if: ${{ inputs.dry_run == 'false' }}
uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
with:
docs_path: new-chart
docs_path: build
github_token: ${{ inputs.token }}

- name: Attach published chart to release
Expand Down
34 changes: 34 additions & 0 deletions .github/actions/publish-ghcr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Chart
description: "Publish to gh-pages-backed chart repository"
inputs:
dry_run:
description: "Is this a dry run. If so no package will be published."
required: true
token:
description: "The GitHub token used to upload artifacts to the published release"
required: true

runs:
using: composite
steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.token }}

- name: Make build directory
shell: bash
run: mkdir -p build

- name: Package the helm chart
shell: bash
run: helm package -d build .

- name: Push chart to GHCR
if: ${{ inputs.dry_run == 'false' }}
shell: bash
run: helm push build/ld-relay-*.tgz oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts
14 changes: 10 additions & 4 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
dry_run:
description: 'Is this a dry run? If so no package will be published.'
description: "Is this a dry run? If so no package will be published."
type: boolean
required: true

Expand All @@ -12,8 +12,9 @@ jobs:
runs-on: ubuntu-latest
# Needed to get tokens during publishing.
permissions:
id-token: write
contents: write
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Contents and pull-requests are for release-please to make releases.
packages: write # needed for ghcr access
steps:
- uses: actions/checkout@v4

Expand All @@ -22,7 +23,12 @@ jobs:
- name: Run quality control checks
uses: ./.github/actions/ci

- uses: ./.github/actions/publish
- uses: ./.github/actions/publish-gh-pages
with:
dry_run: ${{ inputs.dry_run }}
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/publish-ghcr
with:
dry_run: ${{ inputs.dry_run }}
token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 9 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: Run Release Please

on:
push:
branches: [ main ]
branches: [main]

jobs:
release-package:
runs-on: ubuntu-latest
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Contents and pull-requests are for release-please to make releases.
packages: write # needed for ghcr access
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
Expand All @@ -27,7 +28,13 @@ jobs:
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: ./.github/actions/ci

- uses: ./.github/actions/publish
- uses: ./.github/actions/publish-gh-pages
if: ${{ steps.release.outputs.releases_created == 'true' }}
with:
dry_run: false
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/publish-ghcr
if: ${{ steps.release.outputs.releases_created == 'true' }}
with:
dry_run: false
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ unittest: #! Run the unit tests

.PHONY: lint
lint: #! Run helm lint against this chart
@helm lint
@helm lint .

.PHONY: package
package: #! Build the helm package (e.g. ld-relay-x.y.z.tgz)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ helm install ld-relay --set relay.environment.LD_ENV_YourEnvironment=your-sdk-ke

For additional configuration, use the [Configuration options](#configuration-options) below.

OCI artifacts of all LaunchDarkly Helm charts are available in [ghcr.io](https://github.com/orgs/launchdarkly/packages?q=helm-charts).

## Configuration options

To customize this Helm chart, override the configuration options defined in the [values file](https://github.com/launchdarkly/ld-relay-helm/blob/main/values.yaml). The values file contains detailed documentation on each option.
Expand Down