Skip to content

Commit

Permalink
chore(ci): update release process according to new Quarkiverse process
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Oct 16, 2024
1 parent 8e39952 commit f225518
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@ on:
paths:
- '.github/project.yml'

jobs:
release:
runs-on: ubuntu-latest
name: pre release

steps:
- uses: radcortez/project-metadata-action@master
name: retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

- name: Validate version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
jobs:
pre-release:
name: Pre-Release
uses: quarkiverse/.github/.github/workflows/pre-release.yml@main
secrets: inherit
105 changes: 105 additions & 0 deletions .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Quarkiverse Perform Release
run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true

permissions:
attestations: write
id-token: write
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
perform-release:
name: Perform Release
uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
secrets: inherit
with:
version: ${{github.event.inputs.tag || github.ref_name}}

prepare-platform-pr:
name: Prepare Platform Update
runs-on: ubuntu-latest

outputs:
released: ${{steps.wait-for-bom.outputs.published}}
qosdk-version: ${{steps.metadata.outputs.current-version}}
quarkus-platform-branch: ${{steps.versions.outputs.quarkus_platform_branch}}
needs-main-pr: ${{ steps.versions.outputs.needs_main_pr == 'true' }}

steps:
- uses: actions/checkout@v4

- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
local-file: true

- name: Gather versions
id: versions
run: |
echo "quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout)" >> $GITHUB_OUTPUT
quarkus_major=$(echo ${quarkus_version} | cut -d . -f 1,2)
echo "QOSDK-defined Quarkus major version: ${quarkus_major}"
quarkus_platform_version=$(curl -s https://registry.quarkus.io/client/platforms | jq -r '.platforms[0]."current-stream-id"')
echo "Current platform-defined Quarkus major version: ${quarkus_platform_version}"
quarkus_platform_branch=main
if [ "${quarkus_major}" = "${quarkus_platform_version}" ]; then
quarkus_platform_branch="${quarkus_platform_version}"
fi
echo "quarkus_platform_branch=${quarkus_platform_branch}" >> $GITHUB_OUTPUT
if [ "${quarkus_platform_branch}" = "main" ]; then
echo "quarkus-platform update will target main"
echo "need_main_pr=true" >> $GITHUB_OUTPUT
else
echo "quarkus-platform update will target ${quarkus_platform_branch}"
echo "Check if quarkus-platform also needs to be updated on main"
if [ "${{ github.base_ref }}" = "main" ]; then
echo "PR targets main so assume quarkus-platform main also needs to be updated"
echo "need_main_pr=true" >> $GITHUB_OUTPUT
else
echo "No need for PR on quarkus-platform main"
echo "need_main_pr=false" >> $GITHUB_OUTPUT
fi
fi
- name: Wait for QOSDK BOM to be published
uses: quarkusio/monitor-artifact-publication-action@main
id: wait-for-bom
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
group-id: io.quarkiverse.operatorsdk
artifact-id: quarkus-operator-sdk-bom
version: ${{steps.metadata.outputs.current-version}}
initial-delay: 10
poll-delay: 2
poll-iterations: 4
post-delay: 5

update-quarkus-platform:
needs:
- prepare-platform-pr
uses: ./.github/workflows/release-update-quarkus-platform.yml
if: "${{ needs.prepare-platform-pr.outputs.released }}"
with:
qosdk-version: ${{needs.prepare-platform-pr.outputs.qosdk-version}}
quarkus-platform-branch: ${{needs.prepare-platform-pr.outputs.quarkus-platform-branch}}
needs-main-pr: ${{ needs.prepare-platform-pr.outputs.needs-quarkus-platform-main-pr == 'true' }}
secrets:
qosdk-bot-token: ${{ secrets.QOSDK_BOT_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Quarkiverse Prepare Release

on:
pull_request:
types: [ closed ]
paths:
- '.github/project.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
prepare-release:
name: Prepare Release
if: ${{ github.event.pull_request.merged == true}}
uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main
secrets: inherit

0 comments on commit f225518

Please sign in to comment.