Skip to content

Bundle Kubernetes manifests #5

Bundle Kubernetes manifests

Bundle Kubernetes manifests #5

name: Bundle Kubernetes manifests
on:
release:
types: [created]
workflow_dispatch:
inputs:
release:
description: 'Release tag where to create the binaries (as SemVer vX.X.X)'
required: true
default: v0.1.0
permissions:
contents: write
packages: write
jobs:
build:
name: Release Kubernetes manifests
runs-on: ubuntu-latest
steps:
- id: read_tag
name: Read release tag name (mostly vx.x.x)
run: |
if [ "${{ github.event_name }}" = "release" ]; then
export TAG="${{ github.ref_name }}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
export TAG="${{ inputs.release }}"
fi
echo "release_tag=${TAG}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v3
with:
ref: ${{ steps.read_tag.outputs.release_tag }}
- name: Read Go version from go.mod
id: read_go_version
run: |
go_version_raw=$(grep "^go " go.mod | awk '{print $2}')
echo "go_version=${go_version_raw}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v5
with:
go-version: '${{ steps.read_go_version.outputs.go_version }}'
check-latest: true
- id: build
name: Build manifests bundle
env:
RELEASE_TAG: ${{ steps.read_tag.outputs.release_tag }}
run: |
export IMG="ghcr.io/$GITHUB_REPOSITORY:$RELEASE_TAG"
make bundle-build
- name: Attach bundle to the release
uses: softprops/action-gh-release@v2
env:
RELEASE_TAG: ${{ steps.read_tag.outputs.release_tag }}
with:
tag_name: ${{ steps.read_tag.outputs.release_tag }}
body: ""
files: |
deploy/bundle.yaml
append_body: true
generate_release_notes: false