Skip to content

Commit

Permalink
feat: implement TCK build and generator plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Dec 2, 2024
1 parent 4f7eb16 commit 77f14c8
Show file tree
Hide file tree
Showing 22 changed files with 497 additions and 226 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/publish-plugins.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
#

---
name: "Publish Snapshot Build"

on:
workflow_dispatch:
workflow_call:

jobs:
secrets-presence:
name: "Check for required credentials"
runs-on: ubuntu-latest
outputs:
HAS_OSSRH: ${{ steps.secret-presence.outputs.HAS_OSSRH }}
steps:
- name: Check whether secrets exist
id: secret-presence
run: |
[ ! -z "${{ secrets.GPG_PASSPHRASE }}" ] &&
[ ! -z "${{ secrets.GPG_PRIVATE_KEY }}" ] &&
[ ! -z "${{ secrets.OSSRH_PASSWORD }}" ] &&
[ ! -z "${{ secrets.OSSRH_USERNAME }}" ] && echo "HAS_OSSRH=true" >> $GITHUB_OUTPUT
exit 0
Publish-Snapshot:
name: "Publish artefacts to OSSRH Snapshots"
runs-on: ubuntu-latest
needs: [ secrets-presence ]
if: |
needs.secrets-presence.outputs.HAS_OSSRH
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/publish-maven-artifacts
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
osshr-username: ${{ secrets.OSSRH_USERNAME }}
osshr-password: ${{ secrets.OSSRH_PASSWORD }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#

---
name: Create Github Release
name: Create CVF Release
on:
workflow_dispatch:
inputs:
Expand All @@ -32,7 +32,7 @@ env:
TCK_VERSION: ${{ github.event.inputs.tck_version || inputs.tck_version }}

jobs:
Create-Tag:
Prepare-Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -56,7 +56,7 @@ jobs:
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job
if: ${{ !endsWith( needs.Prepare-Release.outputs.tck-version, '-SNAPSHOT') }}
needs:
- Create-Tag
- Prepare-Release
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -75,12 +75,12 @@ jobs:
Bump-Version:
name: 'Update release version'
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job
if: ${{ !endsWith( needs.Create-Tag.outputs.tck-version, '-SNAPSHOT') }}
needs: [ Create-Tag, Github-Release ]
if: ${{ !endsWith( needs.Prepare-Release.outputs.tck-version, '-SNAPSHOT') }}
needs: [ Prepare-Release, Github-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bump-version
with:
target_branch: "main"
base_version: ${{ needs.Create-Tag.outputs.tck-version }}
base_version: ${{ needs.Prepare-Release.outputs.tck-version }}
31 changes: 31 additions & 0 deletions .github/workflows/trigger_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
#

---
name: "Publish Snapshot Build"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
Publish-Snapshot:
# This workflow will abort if the required secrets don't exist
uses: ./.github/workflows/publish-snapshot.yml
secrets: inherit

# Publish-Dependencies:
# uses: eclipse-edc/.github/.github/workflows/publish-dependencies.yml@main
# secrets: inherit
135 changes: 24 additions & 111 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.eclipse.dataspacetck.gradle.tckbuild.extensions.TckBuildExtension

/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
Expand All @@ -15,129 +17,40 @@
plugins {
checkstyle
`maven-publish`
}

subprojects {

// afterEvaluate {
//
// publishing {
// publications.forEach { i ->
// val mp = (i as MavenPublication)
// mp.pom {
// name.set(project.name)
// description.set("Compliance Verification Toolkit")
// url.set("https://projects.eclipse.org/projects/technology.dataspacetck")
//
// licenses {
// license {
// name.set("The Apache License, Version 2.0")
// url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
// }
// developers {
// developer {
// id.set("JimMarino")
// name.set("Jim Marino")
// email.set("[email protected]")
// }
// developer {
// id.set("PaulLatzelsperger")
// name.set("Paul Latzelsperger")
// email.set("[email protected]")
// }
// developer {
// id.set("EnricoRisa")
// name.set("Enrico Risa")
// email.set("[email protected]")
// }
// }
// scm {
// connection.set("scm:git:[email protected]:eclipse-dataspacetck/cvf.git")
// url.set("https://github.com/eclipse-dataspacetck/cvf.git")
// }
// }
// }
// }
// }
//
// }

signing
`java-library`
`version-catalog`
alias(libs.plugins.gradle.publish) apply false
}


// needed for running the dash tool
tasks.register("allDependencies", DependencyReportTask::class)

// disallow any errors
checkstyle {
maxErrors = 0
}

allprojects {
apply(plugin = "checkstyle")
apply(plugin = "maven-publish")
apply(plugin = "java-library")
apply(plugin = "org.eclipse.dataspacetck.tck-build")

configure<JavaPluginExtension> {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
// for all gradle plugins:
pluginManager.withPlugin("java-gradle-plugin") {
apply(plugin = "com.gradle.plugin-publish")
}
}


subprojects {

publishing {
publications {
if (project.subprojects.isEmpty()) {
create<MavenPublication>(project.name) {
artifactId = project.name
from(components["java"])
}
}
// configure POM
configure<TckBuildExtension> {
pom {
scmConnection = "https://github.com/eclipse-dataspacetck/dsp-tck.git"
scmUrl = "scm:git:[email protected]:eclipse-dataspacetck/dsp-tck.git"
groupId = "org.eclipse.dataspacetck.build"
projectName = project.name
description = "DSP Technology Compatibility Kit"
projectUrl = "https://projects.eclipse.org/projects/technology.dataspacetck"
}
}

afterEvaluate {
publishing {
publications.forEach { i ->
val mp = (i as MavenPublication)
mp.pom {
name.set(project.name)
description.set("Compliance Verification Toolkit")
url.set("https://projects.eclipse.org/projects/technology.dataspacetck")

licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
developers {
developer {
id.set("JimMarino")
name.set("Jim Marino")
email.set("[email protected]")
}
developer {
id.set("PaulLatzelsperger")
name.set("Paul Latzelsperger")
email.set("[email protected]")
}
developer {
id.set("EnricoRisa")
name.set("Enrico Risa")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:[email protected]:eclipse-dataspacetck/cvf.git")
url.set("https://github.com/eclipse-dataspacetck/cvf.git")
}
}
}
}
}
// FIXME - workaround for https://github.com/gradle/gradle/issues/26091
val signingTasks = tasks.withType<Sign>()
tasks.withType<AbstractPublishToMaven>().configureEach {
mustRunAfter(signingTasks)
}
}



}
Loading

0 comments on commit 77f14c8

Please sign in to comment.