Skip to content

Commit 432c702

Browse files
move chart into subdirectory. Add release workflow
1 parent de74643 commit 432c702

File tree

19 files changed

+71
-3
lines changed

19 files changed

+71
-3
lines changed

.github/workflows/release.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'charts/*/Chart.yaml'
9+
10+
jobs:
11+
release:
12+
name: Release Helm Chart
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
packages: write
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Configure Git
24+
run: |
25+
git config user.name "$GITHUB_ACTOR"
26+
git config user.email "[email protected]"
27+
28+
- name: Install Helm
29+
uses: azure/setup-helm@v3
30+
31+
- name: Update dependencies
32+
run: helm dependency update charts/sourcebot/
33+
34+
- name: Set Chart Version
35+
id: chart-version
36+
run: |
37+
# Extract chart version from the Chart.yaml
38+
CHART_DIR=$(find ./charts -name "Chart.yaml" -not -path "*/\.git/*" | head -1 | xargs dirname)
39+
CHART_NAME=$(yq e '.name' "$CHART_DIR/Chart.yaml")
40+
CHART_VERSION=$(yq e '.version' "$CHART_DIR/Chart.yaml")
41+
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
42+
echo "chart_dir=$CHART_DIR" >> $GITHUB_OUTPUT
43+
echo "chart_name=$CHART_NAME" >> $GITHUB_OUTPUT
44+
echo "chart_version=$CHART_VERSION" >> $GITHUB_OUTPUT
45+
echo "repo_lower=$REPO_LOWER" >> $GITHUB_OUTPUT
46+
echo "Chart: $CHART_NAME:$CHART_VERSION in $CHART_DIR"
47+
48+
- name: Login to GitHub Container Registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Package Helm Chart
56+
run: |
57+
helm package ${{ steps.chart-version.outputs.chart_dir }} --version ${{ steps.chart-version.outputs.chart_version }}
58+
59+
- name: Push to GitHub Container Registry
60+
run: |
61+
helm push ${{ steps.chart-version.outputs.chart_name }}-${{ steps.chart-version.outputs.chart_version }}.tgz oci://ghcr.io/${{ steps.chart-version.outputs.repo_lower }}/charts
62+
63+
- name: Run chart-releaser
64+
uses: helm/[email protected]
65+
env:
66+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
67+
CR_GENERATE_RELEASE_NOTES: "true"
68+

.github/workflows/validate.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ jobs:
2929
sudo mv helm-docs /usr/local/bin/
3030
3131
- name: Update dependencies
32-
run: helm dependency update charts/
32+
run: helm dependency update charts/sourcebot/
3333

3434
- name: Run helm lint
35-
run: helm lint charts/
35+
run: helm lint charts/sourcebot/
3636

3737
- name: Validate helm-docs
3838
run: |
39-
helm-docs charts/
39+
helm-docs charts/sourcebot/
4040
if [[ $(git diff --stat) != '' ]]; then
4141
echo 'Chart documentation is out of date. Please run helm-docs and commit the changes.'
4242
echo 'Git diff:'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)