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
154 changes: 154 additions & 0 deletions .github/workflows/ai-workspace-helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Release AI Workspace Umbrella Helm Chart

# Publishes the AI Workspace product umbrella (Platform API + AI Workspace UI) to
# GHCR as an OCI artifact. Its component dependencies reference the OCI registry
# and are pinned in Chart.yaml, so the component charts must be published FIRST.
# This workflow logs in, pulls the components (helm dependency update), then
# packages + pushes — otherwise identical to the component release workflows.

on:
workflow_dispatch:
inputs:
version:
description: 'Chart version (e.g., 0.1.0)'
required: true
type: string
appVersion:
description: 'App version (e.g., 1.0.0-beta)'
required: true
type: string

env:
CHART_NAME: ai-workspace
CHART_PATH: kubernetes/helm/ai-workspace-helm-chart
REGISTRY: ghcr.io
REGISTRY_USERNAME: api-platform-bot
Comment thread
coderabbitai[bot] marked this conversation as resolved.
ORGANIZATION: wso2
REGISTRY_PATH: api-platform/helm-charts
CHART_VERSION: ${{ inputs.version }}
APP_VERSION: ${{ inputs.appVersion }}

jobs:
release-helm-chart:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate input formats
run: |
if ! echo "${CHART_VERSION}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$'; then
echo "::error::Invalid version '${CHART_VERSION}'. Expected semver (e.g. 0.1.0 or 0.1.0-rc.1)."
exit 1
fi
if ! echo "${APP_VERSION}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$'; then
echo "::error::Invalid appVersion '${APP_VERSION}'. Expected semver (e.g. 1.0.0-beta)."
exit 1
fi

- name: Check tag does not already exist
run: |
TAG="helm-${CHART_NAME}-${CHART_VERSION}"
if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then
echo "::error::Tag '$TAG' already exists. Bump the version or delete the tag first."
exit 1
fi
echo "Tag '$TAG' is free. Proceeding."

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'

- name: Update Chart version
working-directory: ${{ env.CHART_PATH }}
run: |
sed -i "s/^version:.*/version: ${CHART_VERSION}/" Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${APP_VERSION}\"/" Chart.yaml
echo "Updated Chart.yaml:"
cat Chart.yaml

- name: Login to GitHub Container Registry
run: |
echo "${{ secrets.API_PLATFORM_BOT_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ env.REGISTRY_USERNAME }} --password-stdin

- name: Resolve dependencies
working-directory: ${{ env.CHART_PATH }}
# Pulls the component charts pinned in Chart.yaml from GHCR — they must
# already be published at those versions (release the components first).
run: |
helm dependency update .
ls -la charts/*.tgz

- name: Package Helm chart
working-directory: ${{ env.CHART_PATH }}
run: |
helm package .
echo "Packaged chart:"
ls -la *.tgz

- name: Push Helm chart
working-directory: ${{ env.CHART_PATH }}
run: |
helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}"

- name: Commit and push version changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ${{ env.CHART_PATH }}/Chart.yaml
if ! git diff --cached --quiet; then
git commit -m "chore: bump helm-${CHART_NAME} chart version to ${CHART_VERSION}"
git push
else
echo "No changes to commit"
fi

- name: Create and push git tag
run: |
TAG="helm-${CHART_NAME}-${CHART_VERSION}"
git tag "$TAG"
git push origin "refs/tags/$TAG"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: helm-${{ env.CHART_NAME }}-${{ inputs.version }}
name: AI Workspace Helm Chart ${{ inputs.version }}
body: |
## AI Workspace Helm Chart Release ${{ inputs.version }}

**App Version:** `${{ inputs.appVersion }}`

AI Workspace product package — shared Platform API + the AI Workspace UI.

### Installation
```bash
helm install ${{ env.CHART_NAME }} oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}/${{ env.CHART_NAME }} --version ${{ inputs.version }}
```

### OCI Registry
`oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}/${{ env.CHART_NAME }}:${{ inputs.version }}`
draft: true
prerelease: ${{ contains(inputs.version, '-') }}
token: ${{ secrets.API_PLATFORM_BOT_TOKEN }}


- name: Chart Summary
run: |
echo "### AI Workspace Helm Chart Released :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Chart Name:** \`${CHART_NAME}\`" >> $GITHUB_STEP_SUMMARY
echo "**Chart Version:** \`${CHART_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**App Version:** \`${APP_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**Git Tag:** \`helm-${CHART_NAME}-${CHART_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**Registry:** \`oci://${REGISTRY}/${ORGANIZATION}/${REGISTRY_PATH}/${CHART_NAME}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### Install Command" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "helm install ${CHART_NAME} oci://${REGISTRY}/${ORGANIZATION}/${REGISTRY_PATH}/${CHART_NAME} --version ${CHART_VERSION}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
154 changes: 154 additions & 0 deletions .github/workflows/developer-portal-helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Release Developer Portal Umbrella Helm Chart

# Publishes the Developer Portal product umbrella (Platform API + Developer Portal
# UI) to GHCR as an OCI artifact. Its component dependencies reference the OCI
# registry and are pinned in Chart.yaml, so the component charts must be published
# FIRST. This workflow logs in, pulls the components (helm dependency update),
# then packages + pushes — otherwise identical to the component release workflows.

on:
workflow_dispatch:
inputs:
version:
description: 'Chart version (e.g., 0.1.0)'
required: true
type: string
appVersion:
description: 'App version (e.g., 1.0.0-beta)'
required: true
type: string

env:
CHART_NAME: developer-portal
CHART_PATH: kubernetes/helm/developer-portal-helm-chart
REGISTRY: ghcr.io
REGISTRY_USERNAME: api-platform-bot
ORGANIZATION: wso2
REGISTRY_PATH: api-platform/helm-charts
CHART_VERSION: ${{ inputs.version }}
APP_VERSION: ${{ inputs.appVersion }}

jobs:
release-helm-chart:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate input formats
run: |
if ! echo "${CHART_VERSION}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$'; then
echo "::error::Invalid version '${CHART_VERSION}'. Expected semver (e.g. 0.1.0 or 0.1.0-rc.1)."
exit 1
fi
if ! echo "${APP_VERSION}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$'; then
echo "::error::Invalid appVersion '${APP_VERSION}'. Expected semver (e.g. 1.0.0-beta)."
exit 1
fi

- name: Check tag does not already exist
run: |
TAG="helm-${CHART_NAME}-${CHART_VERSION}"
if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then
echo "::error::Tag '$TAG' already exists. Bump the version or delete the tag first."
exit 1
fi
echo "Tag '$TAG' is free. Proceeding."

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'

- name: Update Chart version
working-directory: ${{ env.CHART_PATH }}
run: |
sed -i "s/^version:.*/version: ${CHART_VERSION}/" Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${APP_VERSION}\"/" Chart.yaml
echo "Updated Chart.yaml:"
cat Chart.yaml

- name: Login to GitHub Container Registry
run: |
echo "${{ secrets.API_PLATFORM_BOT_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ env.REGISTRY_USERNAME }} --password-stdin

- name: Resolve dependencies
working-directory: ${{ env.CHART_PATH }}
# Pulls the component charts pinned in Chart.yaml from GHCR — they must
# already be published at those versions (release the components first).
run: |
helm dependency update .
ls -la charts/*.tgz

- name: Package Helm chart
working-directory: ${{ env.CHART_PATH }}
run: |
helm package .
echo "Packaged chart:"
ls -la *.tgz

- name: Push Helm chart
working-directory: ${{ env.CHART_PATH }}
run: |
helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}"

- name: Commit and push version changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ${{ env.CHART_PATH }}/Chart.yaml
if ! git diff --cached --quiet; then
git commit -m "chore: bump helm-${CHART_NAME} chart version to ${CHART_VERSION}"
git push
else
echo "No changes to commit"
fi

- name: Create and push git tag
run: |
TAG="helm-${CHART_NAME}-${CHART_VERSION}"
git tag "$TAG"
git push origin "refs/tags/$TAG"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: helm-${{ env.CHART_NAME }}-${{ inputs.version }}
name: Developer Portal Helm Chart ${{ inputs.version }}
body: |
## Developer Portal Helm Chart Release ${{ inputs.version }}

**App Version:** `${{ inputs.appVersion }}`

Developer Portal product package — shared Platform API + the Developer Portal UI.

### Installation
```bash
helm install ${{ env.CHART_NAME }} oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}/${{ env.CHART_NAME }} --version ${{ inputs.version }}
```

### OCI Registry
`oci://${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.REGISTRY_PATH }}/${{ env.CHART_NAME }}:${{ inputs.version }}`
draft: true
prerelease: ${{ contains(inputs.version, '-') }}
token: ${{ secrets.API_PLATFORM_BOT_TOKEN }}


- name: Chart Summary
run: |
echo "### Developer Portal Helm Chart Released :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Chart Name:** \`${CHART_NAME}\`" >> $GITHUB_STEP_SUMMARY
echo "**Chart Version:** \`${CHART_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**App Version:** \`${APP_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**Git Tag:** \`helm-${CHART_NAME}-${CHART_VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "**Registry:** \`oci://${REGISTRY}/${ORGANIZATION}/${REGISTRY_PATH}/${CHART_NAME}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "#### Install Command" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "helm install ${CHART_NAME} oci://${REGISTRY}/${ORGANIZATION}/${REGISTRY_PATH}/${CHART_NAME} --version ${CHART_VERSION}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
19 changes: 19 additions & 0 deletions kubernetes/helm/ai-workspace-helm-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Common Helm ignores
.DS_Store
.git/
.gitignore
.idea/
.vscode/
Thumbs.db
*.swp
*.tmp
*.bak

# Examples and documentation
examples/

# Local development overrides (not shipped)
values-local.yaml

# Generated / local — never package
values-secrets.yaml
39 changes: 39 additions & 0 deletions kubernetes/helm/ai-workspace-helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v2
name: ai-workspace
kubeVersion: ">=1.24.0-0"
description: >-
WSO2 API Platform — AI Workspace product package. Chart whose default
profile is the shared Platform API control plane plus the AI Workspace UI. Each
component is a separately-released chart pulled as an OCI dependency; add other
components (e.g. the Developer Portal) later by appending a dependency.
version: 1.0.0-alpha2
appVersion: "1.0.0-alpha2"
type: application
home: https://github.com/wso2/api-platform
sources:
- https://github.com/wso2/api-platform
keywords:
- api-platform
- ai-workspace
- platform-api
- wso2
maintainers:
- name: ap-portals-maintainers
email: contact@wso2.com
dependencies:
# NOTE: repositories below reference the OCI registry (the release default), so
# `helm dependency update` pulls the components from ghcr (requires them to be
# published + `helm registry login ghcr.io`). For local development WITHOUT
# publishing, temporarily switch each to repository: "file://../<name>-helm-chart"
# and re-run `helm dependency update`.
#
# Shared control plane. On by default; the UI reaches it in-cluster.
- name: platform-api
version: "0.13.0"
repository: "oci://ghcr.io/wso2/api-platform/helm-charts"
condition: platform-api.enabled
# AI Workspace UI — this package's headline component.
- name: ai-workspace-ui
version: "1.0.0-alpha"
repository: "oci://ghcr.io/wso2/api-platform/helm-charts"
condition: ai-workspace-ui.enabled
Loading
Loading