Skip to content

Commit

Permalink
build: add prepare 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 c8f1ea0 commit e6e78a3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 81 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Prepare Release

on:
workflow_dispatch:
inputs:
version:
description: the version to be released. If it ends with '.0' a proper release is created, bugfix otherwise
required: true
type: string

jobs:
Prepare-Release:
uses: eclipse-edc/.github/.github/workflows/technology-prepare-release.yml@main
secrets: inherit
with:
version: ${{ inputs.version }}
50 changes: 7 additions & 43 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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 @@ -58,50 +58,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-aws.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 @@ -116,4 +80,4 @@ jobs:
status: ${{ needs.Publish-Components.result == 'skipped' && 'Failure' || needs.Publish-Artefacts.result }}
title: "Release Build Technology AWS"
description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}"
username: GitHub Actions
username: GitHub Actions
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Release

on:
workflow_dispatch:


jobs:
Release:
uses: eclipse-edc/.github/.github/workflows/technology-release.yml@main
secrets: inherit
38 changes: 0 additions & 38 deletions .github/workflows/test-repo-split.yaml

This file was deleted.

0 comments on commit e6e78a3

Please sign in to comment.