Skip to content

Commit

Permalink
feat(ci): add release capabilities to publish job
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Latzelsperger <[email protected]>
  • Loading branch information
paullatzelsperger committed May 24, 2024
1 parent 1966153 commit 4f73450
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/nightly.yaml → .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly
name: Create and Publish Release

on:
workflow_dispatch:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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()"
Expand All @@ -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
6 changes: 6 additions & 0 deletions .github/workflows/release-tech-gcp.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 4f73450

Please sign in to comment.