From 4f7345022657e84cd9775f0854e0b159e1bab002 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Fri, 24 May 2024 19:39:41 +0200 Subject: [PATCH] feat(ci): add release capabilities to publish job Signed-off-by: Paul Latzelsperger --- .github/workflows/{nightly.yaml => publish.yaml} | 15 +++++++++++++-- .github/workflows/release-tech-gcp.yml | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) rename .github/workflows/{nightly.yaml => publish.yaml} (89%) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/publish.yaml similarity index 89% rename from .github/workflows/nightly.yaml rename to .github/workflows/publish.yaml index 4450dd71..a263acae 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/publish.yaml @@ -1,4 +1,4 @@ -name: Nightly +name: Create and Publish Release on: workflow_dispatch: @@ -29,6 +29,7 @@ jobs: [ ! -z "${{ secrets.DISCORD_WEBHOOK_GITHUB }}" ] && echo "HAS_WEBHOOK=true" >> $GITHUB_OUTPUT exit 0 + Determine-Version: runs-on: ubuntu-latest outputs: @@ -44,6 +45,7 @@ jobs: echo "VERSION=${{ env.INPUT_VERSION }}" >> "$GITHUB_OUTPUT" fi + Run-Tests: needs: [ Secrets-Presence, Determine-Version ] uses: ./.github/workflows/verify.yaml @@ -83,6 +85,15 @@ jobs: echo "Publishing Version $VERSION to Sonatype" ./gradlew publishToSonatype ${cmd} --no-parallel -Pversion=$VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" + + # If we have a release version, also invoke the GH release job, bump versions, etc. + Create-GitHub-Release: + needs: [ Publish-Artefacts, Determine-Version ] + if: ${{ !endsWith(needs.Determine-Version.outputs.VERSION, '-SNAPSHOT') }} + uses: ./.github/workflows/release-tech-gcp.yml + with: + edc_version: ${{ needs.Determine-Version.outputs.VERSION }} + Post-To-Discord: needs: [ Publish-Artefacts, Determine-Version, Secrets-Presence ] if: "needs.Secrets-Presence.outputs.HAS_WEBHOOK && always()" @@ -94,6 +105,6 @@ jobs: webhook: ${{ secrets.DISCORD_WEBHOOK_GITHUB }} # if the publishing is skipped, that means the preceding test run failed status: ${{ needs.Publish-Components.result == 'skipped' && 'Failure' || needs.Publish-Artefacts.result }} - title: "Nightly Build Technology GCP" + title: "Release Build Technology GCP" description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}" username: GitHub Actions \ No newline at end of file diff --git a/.github/workflows/release-tech-gcp.yml b/.github/workflows/release-tech-gcp.yml index 48a01afd..57dce2a6 100644 --- a/.github/workflows/release-tech-gcp.yml +++ b/.github/workflows/release-tech-gcp.yml @@ -1,5 +1,11 @@ name: Create Release of Technology-GCP on: + workflow_call: + inputs: + edc_version: + description: 'Version string that is used for publishing (e.g. "1.0.0", NOT "v1.0.0"). Appending -SNAPSHOT will create a snapshot release.' + required: true + type: string workflow_dispatch: inputs: edc_version: