Skip to content

fix: constrain kube version to v1 by default #24

fix: constrain kube version to v1 by default

fix: constrain kube version to v1 by default #24

Workflow file for this run

name: release
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
tag:
description: Tag to release
required: true
jobs:
goreleaser:
name: goreleaser
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
attestations: write
env:
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
owner: "${{ github.repository_owner }}"
repositories: |
kclipper
homebrew-tap
nur-packages
- name: Checkout
uses: actions/checkout@v5
with:
token: "${{ steps.app-token.outputs.token }}"
ref: ${{ github.event.inputs.tag != '' && format('refs/tags/{0}', github.event.inputs.tag) || github.ref }}
fetch-depth: 0
persist-credentials: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Release in devbox
run: devbox run -- task go-release
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v3
with:
subject-checksums: ./dist/checksums.txt
kcl-mod:
name: kcl-mod
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.tag != '' && format('refs/tags/{0}', github.event.inputs.tag) || github.ref }}
fetch-depth: 0
persist-credentials: false
- name: Set up KCL
run: wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash
- name: Login to GitHub Container Registry
run: kcl registry login -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
env:
GITHUB_ACTOR: ${{ github.actor }}
- name: Publish KCL packages
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/kclipper/$PKG_NAME
fi
cd -
fi
done