Skip to content

v0.6.0

v0.6.0 #7

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
image_version:
description: 'image version for image build'
required: false
type: string
release:
types:
- created
env:
IMAGE_NAME: kite
GO_VERSION: "1.24.3"
NODE_VERSION: "24"
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'zxh326' }}
permissions:
packages: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker hub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: ui/pnpm-lock.yaml
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install deps
run: make deps
- name: Build
run: make cross-compile
- name: Check version
id: check_version
run: |
if [ ${{ inputs.image_version }} ]; then
IMAGE_TAG=${{ inputs.image_version }}
else
IMAGE_TAG=$(git describe --tags --match 'v*' | grep -oE 'v[0-9]+\.[0-9][0-9]*(\.[0-9]+)?')
fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.binary
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
zzde/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
zzde/${{ env.IMAGE_NAME }}:latest
labels: runnumber=${{ github.run_id }}
- name: Package binaries
run: make package-binaries
- name: Upload binary packages to release
run: |
echo "Uploading all kite binary packages..."
gh release upload ${{ github.event.release.tag_name }} bin/kite-*-${{ github.event.release.tag_name }}.tar.gz --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-helm-chart:
runs-on: ubuntu-latest
needs: push
permissions:
packages: write
contents: write
if: ${{ github.repository_owner == 'zxh326' && github.event_name == 'release' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump helm chart version and commit
if: ${{ github.event_name == 'release' }}
run: |
make release-helm-chart
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# Check if there are any changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Local changes detected, committing and pushing..."
git add .
git commit -m "[ci skip] Bump helm chart version to ${{ github.event.release.tag_name }}"
git push
else
echo "No local changes to push"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_RELEASE_NAME_TEMPLATE: helm-chart-{{ .Version }}
CR_SKIP_EXISTING: true
with:
charts_dir: charts