Skip to content

Add a KCL module to wrap the helm plugin #11

Add a KCL module to wrap the helm plugin

Add a KCL module to wrap the helm plugin #11

Workflow file for this run

name: release
on:
push:
tags:
- v*
permissions:
contents: write
packages: write
jobs:
goreleaser:
name: goreleaser
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.10.1
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Set Variables
run: |
echo "HOSTNAME=$(hostname)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SKIP_DARWIN_BUILD: "true"
kcl-mod:
name: kcl-mod
runs-on: ubuntu-latest
steps:
- name: Install kcl
run: wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
run: kcl registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Publish to GitHub Container Registry
run: |
# Get the tag version without the 'v' prefix
VERSION=${GITHUB_REF#refs/tags/v}
# Find all directories under modules
for dir in ./modules/*/; do
if [ -d "$dir" ]; then
echo "Processing module: $dir"
cd "$dir"
if [ -f "kcl.mod" ]; then
PKG_NAME=$(basename $dir)
# Update the version in kcl.mod file
sed -i "s/^version = .*/version = \"${VERSION}\"/" "kcl.mod"
echo "Publishing module: $PKG_NAME"
cat kcl.mod
kcl mod push oci://ghcr.io/macropower/kclx/$PKG_NAME
fi
cd -
fi
done