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 23251c1 commit e1b1677
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 136 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-az.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 AZURE"
description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}"
username: GitHub Actions
username: GitHub Actions
81 changes: 0 additions & 81 deletions .github/workflows/release-tech-az.yml

This file was deleted.

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
11 changes: 2 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,17 @@ plugins {

val techAzScmUrl: String by project
val techAzScmConnection: String by project
val annotationProcessorVersion: String by project

buildscript {
dependencies {
val edcGradlePluginsVersion: String by project
classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${edcGradlePluginsVersion}")
val version: String by project
classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${version}")
}
}

allprojects {
apply(plugin = "org.eclipse.edc.edc-build")

// configure which version of the annotation processor to use. defaults to the same version as the plugin
configure<org.eclipse.edc.plugins.autodoc.AutodocExtension> {
processorVersion.set(annotationProcessorVersion)
outputDirectory.set(project.layout.buildDirectory.asFile.get())
}

configure<org.eclipse.edc.plugins.edcbuild.extensions.BuildExtension> {
pom {
scmUrl.set(techAzScmConnection)
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
group=org.eclipse.edc.azure
version=0.7.1
# configure the build:
annotationProcessorVersion=0.7.1
edcGradlePluginsVersion=0.7.1
# used for publishing artifacts and plugins
techAzScmConnection=scm:git:[email protected]:eclipse-edc/Technology-Azure.git
techAzScmUrl=https://github.com/eclipse-edc/Technology-Azure.git

0 comments on commit e1b1677

Please sign in to comment.