Skip to content

Commit

Permalink
Merge pull request #43632 from gastaldi/split_workflow
Browse files Browse the repository at this point in the history
Split Quarkiverse release into two workflows
  • Loading branch information
gsmet authored Oct 2, 2024
2 parents c5d2f44 + 23e2cdd commit 1b1d1a0
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

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'

- name: Validate version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
pre-release:
name: Pre-Release
uses: quarkiverse/.github/.github/workflows/pre-release.yml@main
secrets: inherit
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quarkiverse Release
name: Quarkiverse Prepare Release

on:
pull_request:
Expand All @@ -16,11 +16,3 @@ jobs:
if: ${{ github.event.pull_request.merged == true}}
uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main
secrets: inherit

perform-release:
name: Perform Release
needs: prepare-release
uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
secrets: inherit
with:
version: ${{needs.prepare-release.outputs.release-version}}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public void testCreateQuarkiverseExtension(TestInfo testInfo) throws Throwable {
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/build.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/pre-release.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/quarkus-snapshot.yaml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/release.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/release-perform.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/.github/workflows/release-prepare.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/docs/pom.xml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/docs/antora.yml");
assertThatMatchSnapshot(testInfo, testDirPath, "quarkus-my-quarkiverse-ext/docs/modules/ROOT/nav.adoc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ quarkus-my-quarkiverse-ext/.github/workflows/build.yml
quarkus-my-quarkiverse-ext/.github/workflows/deploy-snapshots.yml.disabled
quarkus-my-quarkiverse-ext/.github/workflows/pre-release.yml
quarkus-my-quarkiverse-ext/.github/workflows/quarkus-snapshot.yaml
quarkus-my-quarkiverse-ext/.github/workflows/release.yml
quarkus-my-quarkiverse-ext/.github/workflows/release-perform.yml
quarkus-my-quarkiverse-ext/.github/workflows/release-prepare.yml
quarkus-my-quarkiverse-ext/.gitignore
quarkus-my-quarkiverse-ext/LICENSE
quarkus-my-quarkiverse-ext/README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

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'

- name: Validate version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
pre-release:
name: Pre-Release
uses: quarkiverse/.github/.github/workflows/pre-release.yml@main
secrets: inherit
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Quarkiverse Release
name: Quarkiverse Prepare Release

on:
pull_request:
Expand All @@ -16,11 +16,3 @@ jobs:
if: ${{ github.event.pull_request.merged == true}}
uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main
secrets: inherit

perform-release:
name: Perform Release
needs: prepare-release
uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
secrets: inherit
with:
version: ${{needs.prepare-release.outputs.release-version}}

0 comments on commit 1b1d1a0

Please sign in to comment.