76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: Pre-Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Release tag (e.g. v0.4.0)"
|
|
required: true
|
|
type: string
|
|
branch:
|
|
description: "Branch to use (default: main)"
|
|
required: false
|
|
default: "main"
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
generate-crds:
|
|
name: Generate CRDs and Installer
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout branch
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.inputs.branch || 'main' }}
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: k8s/migration/go.mod
|
|
cache-dependency-path: k8s/migration/go.sum
|
|
|
|
- name: Install controller-gen
|
|
run: |
|
|
go install sigs.k8s.io/controller-tools/cmd/[email protected]
|
|
|
|
- name: Setup Kustomize
|
|
uses: imranismail/setup-kustomize@v2
|
|
with:
|
|
kustomize-version: '5.3.0'
|
|
|
|
- name: Run build-installer
|
|
run: |
|
|
cd k8s/migration
|
|
make build-installer TAG=${{ github.event.inputs.tag }}
|
|
|
|
- name: Check for changes
|
|
id: changes
|
|
run: |
|
|
if [[ -n "$(git status --porcelain)" ]]; then
|
|
echo "changes=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "changes=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Disable git hooks
|
|
if: steps.changes.outputs.changes == 'true'
|
|
run: git config core.hooksPath /dev/null
|
|
|
|
- name: Create Pull Request
|
|
if: steps.changes.outputs.changes == 'true'
|
|
uses: peter-evans/create-pull-request@v6
|
|
with:
|
|
branch: pre-release/${{ github.event.inputs.tag }}
|
|
base: main
|
|
commit-message: "chore: generate CRDs and installer for ${{ github.event.inputs.tag }}"
|
|
title: "chore: Pre-release CRD generation for ${{ github.event.inputs.tag }}"
|
|
body: |
|
|
Auto-generated CRDs and installer manifests for `${{ github.event.inputs.tag }}`.
|
|
|
|
Please review and merge before creating the release. |