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
#977)

* chore(ci): update release process according to new Quarkiverse process

Signed-off-by: Chris Laprun <[email protected]>

* chore(ci): retrieve release version from github environment

Signed-off-by: Chris Laprun <[email protected]>

* chore(ci): remove now obsolete release workflow

Signed-off-by: Chris Laprun <[email protected]>

* fix: deactivate samples when releasing

Signed-off-by: Chris Laprun <[email protected]>

---------

Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm authored Oct 28, 2024
1 parent 8e99924 commit 4552b5e
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 142 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
96 changes: 96 additions & 0 deletions .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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}}
quarkus-platform-branch: ${{steps.versions.outputs.quarkus_platform_branch}}
needs-main-pr: ${{ steps.versions.outputs.needs_main_pr == 'true' }}

steps:
- uses: actions/checkout@v4

- 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: ${{github.event.inputs.tag || github.ref_name}}
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: ${{github.event.inputs.tag || github.ref_name}}
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
125 changes: 0 additions & 125 deletions .github/workflows/release.yml

This file was deleted.

11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@
<module>samples</module>
</modules>
</profile>
<profile>
<id>no-samples-in-release</id>
<activation>
<property>
<name>!performRelease</name>
</property>
</activation>
<modules>
<module>samples</module>
</modules>
</profile>
<profile>
<id>no-docs</id>
<activation>
Expand Down

0 comments on commit 4552b5e

Please sign in to comment.