Skip to content

Commit

Permalink
build: cleanup publish and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Aug 14, 2024
1 parent 1eb566b commit 1654194
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 128 deletions.
54 changes: 8 additions & 46 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Create and Publish Release
name: Create and Publish Maven Artifacts

on:
workflow_dispatch:
inputs:
version:
description: Semantic Version string to use for this nightly build
description: Semantic Version string to use for this nightly build. It should ends with `-SNAPSHOT`. If not, please take a look at the release workflow.
required: false
schedule:
- cron: "0 3 * * *" # run at 03:00 UTC
Expand Down Expand Up @@ -45,7 +45,6 @@ jobs:
echo "VERSION=${{ env.INPUT_VERSION }}" >> "$GITHUB_OUTPUT"
fi
Run-Tests:
needs: [ Secrets-Presence, Determine-Version ]
uses: ./.github/workflows/verify.yaml
Expand All @@ -58,51 +57,14 @@ jobs:
needs: [ Secrets-Presence, Run-Tests, Determine-Version ]
if: |
needs.Secrets-Presence.outputs.HAS_OSSRH
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main

# Import GPG Key
- uses: eclipse-edc/.github/.github/actions/import-gpg-key@main
if: |
needs.Secrets-Presence.outputs.HAS_OSSRH
name: "Import GPG Key"
- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
version: ${{ needs.Determine-Version.outputs.VERSION }}
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}

- name: Set correct version
env:
VERSION: ${{ needs.Determine-Version.outputs.VERSION }}
run: |
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
grep -rlz "$existingVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$existingVersion/$VERSION/g"
- name: "Publish To OSSRH/MavenCentral"
if: |
needs.Secrets-Presence.outputs.HAS_OSSRH
env:
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }}
VERSION: ${{ needs.Determine-Version.outputs.VERSION }}
run: |-
cmd=""
if [[ $VERSION != *-SNAPSHOT ]]
then
cmd="closeAndReleaseSonatypeStagingRepository";
fi
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 }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}

Post-To-Discord:
needs: [ Publish-Artefacts, Determine-Version, Secrets-Presence ]
Expand All @@ -117,4 +79,4 @@ jobs:
status: ${{ needs.Publish-Components.result == 'skipped' && 'Failure' || needs.Publish-Artefacts.result }}
title: "Release Build Technology GCP"
description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}"
username: GitHub Actions
username: GitHub Actions
82 changes: 0 additions & 82 deletions .github/workflows/release-tech-gcp.yml

This file was deleted.

0 comments on commit 1654194

Please sign in to comment.