Skip to content

Publish Snapshot Public Operator #111

Publish Snapshot Public Operator

Publish Snapshot Public Operator #111

name: Publish Public Operator
run-name: ${{ format('Publish {0} Public Operator', inputs.release_type) }}
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: The type of release
options:
- Snapshot
- Patch
- Minor
- Major
version_number_input:
description: If set, the version number will not be incremented and the given number will be used.
type: string
default: ''
vulnerability_severity:
description: The severity to fail the workflow if such vulnerability is detected. DO NOT override it unless a Jira ticket is raised.
type: choice
options:
- CRITICAL,HIGH
- CRITICAL,HIGH,MEDIUM
- CRITICAL (DO NOT use if JIRA ticket not raised)
workflow_call:
inputs:
release_type:
description: The type of version number to return. Must be one of [Snapshot, Patch, Minor or Major]
required: true
type: string
version_number_input:
description: If set, the version number will not be incremented and the given number will be used.
type: string
default: ''
vulnerability_severity:
description: The severity to fail the workflow if such vulnerability is detected. DO NOT override it unless a Jira ticket is raised. Must be one of ['CRITICAL', 'CRITICAL,HIGH' or 'CRITICAL,HIGH,MEDIUM'] (without space in between).
type: string
default: 'CRITICAL,HIGH'
outputs:
image_tag:
description: The tag used to describe the image in Docker
value: ${{ jobs.Image.outputs.image_tag }}
jobs:
check_major:
name: Check if major release
runs-on: ubuntu-latest
steps:
- name: Approve Major release
if: inputs.release_type == 'Major'
uses: trstringer/manual-approval@v1
with:
secret: ${{ github.token }}
approvers: thomasm-ttd,atarassov-ttd,cody-constine-ttd
minimum-approvals: 1
issue-title: Creating Major version of UID2-Operator
image:
name: Image
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-publish-java-to-docker-versioned.yaml@v3
needs: check_major
with:
release_type: ${{ inputs.release_type }}
version_number_input: ${{ inputs.version_number_input }}
force_release: 'no' # Do not create a release for the component builds, will be created by the parent
vulnerability_severity: ${{ inputs.vulnerability_severity }}
java_version: 21
secrets: inherit
e2e:
name: E2E
uses: ./.github/workflows/run-e2e-tests-on-operator.yaml
needs: image
with:
operator_image_version: ${{ needs.image.outputs.image_tag }}
secrets: inherit
collectPublicArtifacts:
name: Collect Public Artifacts
runs-on: ubuntu-latest
needs: [e2e,image]
steps:
- name: Collect artifacts
run: |
mkdir -p image-details
IMAGE_TAG=${{ needs.image.outputs.image_tag }}
IMAGE=$(jq -n --arg img "$IMAGE_TAG" '{image_tag: $img}')
echo $IMAGE > image-details/public-image-$IMAGE_TAG.json
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: public-image-${{ needs.image.outputs.image_tag }}
path: image-details/