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
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Setup"
description: "install dependencies"
runs:
using: composite
steps:
- uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
- uses: docker/setup-buildx-action@v3
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
22 changes: 8 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]
branches: [main]

jobs:
build-lint:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: CI
run: make ci
- name: Build
run: make build
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: CI
run: make ci
- name: Build
run: make build
40 changes: 40 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: e2e

on:
push:
branches: ["feature/*"]
# pull_request:
# branches: [main]

jobs:
e2e:
permissions:
contents: read
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup

- name: Install kubectl
run: |
set -euo pipefail
ARCH=amd64
VERSION=v1.30.2
curl -sSL -o kubectl https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

- name: Install kind
run: |
set -euo pipefail
KIND_VERSION=v0.31.0
curl -sSL -o kind https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64
sudo install -o root -g root -m 0755 kind /usr/local/bin/kind

- name: Run limit end-to-end tests
env:
GOCACHE: /tmp/go-build
run: make e2e

- name: Delete cluster
run: /usr/local/bin/kind delete cluster
80 changes: 35 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"

permissions:
contents: write
Expand All @@ -14,52 +14,42 @@ env:
ONLINE_REGISTER_USER: ${{ github.actor }}
ONLINE_REGISTER_PASSWORD: ${{ secrets.PACKAGE_TOKEN }}


jobs:
release:
if: github.repository == 'kcrow-io/plugins'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Login to online register
uses: docker/login-action@v4
with:
username: ${{ env.ONLINE_REGISTER_USER }}
password: ${{ env.ONLINE_REGISTER_PASSWORD }}
registry: ${{ env.ONLINE_REGISTER }}

- name: Build and Push Image
uses: docker/build-push-action@v7
id: docker_build_release
with:
context: .
file: Dockerfile
push: true
provenance: false
platforms: ${{ env.BUILD_PLATFORM }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}:${{ github.ref_name }},
${{ env.ONLINE_REGISTER }}/${{ github.repository }}:latest
build-args: |
GIT_COMMIT_VERSION=${{ env.commitver }}
GIT_COMMIT_TIME=${{ env.committime }}
VERSION=${{ github.ref_name }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Login to online register
uses: docker/login-action@v3
with:
username: ${{ env.ONLINE_REGISTER_USER }}
password: ${{ env.ONLINE_REGISTER_PASSWORD }}
registry: ${{ env.ONLINE_REGISTER }}

- name: Build and Push Image
uses: docker/build-push-action@v6
id: docker_build_release
with:
context: .
file: Dockerfile
push: true
provenance: false
platforms: ${{ env.BUILD_PLATFORM }}
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}:${{ github.ref_name }},
${{ env.ONLINE_REGISTER }}/${{ github.repository }}:latest
build-args: |
GIT_COMMIT_VERSION=${{ env.commitver }}
GIT_COMMIT_TIME=${{ env.committime }}
VERSION=${{ github.ref_name }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ test/e2edebugLog.txt
.plan*
.claude*

plans/

out/
bin/
Loading
Loading