Skip to content

CI updates and bump operator version #118

CI updates and bump operator version

CI updates and bump operator version #118

Workflow file for this run

name: operator
on:
workflow_dispatch:
pull_request:
paths:
- operator/**
- "!operator/webhook/**"
- .github/workflows/operator.yml
- .github/workflows/scripts
push:
branches:
- main
paths:
- operator/**
- "!operator/webhook/**"
env:
WORKING_DIR: ./operator
jobs:
verify-versions:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sh .github/workflows/scripts/verify_operator_releasable.sh
name: Verify operator is in a state to be released on merge
build:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ env.WORKING_DIR }}
steps:
- uses: actions/checkout@v4
- run: make prep-release
name: generate release files
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ env.WORKING_DIR }}
steps:
- uses: actions/checkout@v4
# set variables used by multiple steps in the job
- run: |
TAG_NAME=$(make get-tag)
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
id: naming-selector
name: generate names for artifacts
- run: |
git fetch --tags
if ! git rev-parse -q --verify "refs/tags/${{ steps.naming-selector.outputs.TAG_NAME }}"; then
echo "needs_release=true" >> $GITHUB_ENV
fi
name: check if release is needed
- run: make prep-release
if: env.needs_release == 'true'
name: generate release files
- uses: mathieudutour/[email protected]
if: env.needs_release == 'true'
id: tag_version
with:
custom_tag: ${{ steps.naming-selector.outputs.TAG_NAME }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# avoid v prefix before tag
tag_prefix: ""
- uses: ncipollo/release-action@v1
if: env.needs_release == 'true'
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
artifactErrorsFailBuild: true
artifacts: ${{ env.WORKING_DIR }}/output/*