From 4e94b2f470236b4cd757708a4673eb99b15b528d Mon Sep 17 00:00:00 2001 From: Eric Eilebrecht Date: Mon, 23 Oct 2023 16:08:30 -0700 Subject: [PATCH 1/2] Settings for jitpack --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 43 ----------------------------------- jitpack.yml | 2 ++ 3 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 jitpack.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fc7341..ee8923b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle -name: Build +name: Build and Test on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index cd48739..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle - -name: Publish to GitHub Packages - -on: - release: - types: [created] - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - server-id: github - settings-path: ${{ github.workspace }} - - - name: Build with Gradle - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: build -Prelease - - - name: Publish to GitHub Packages - uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: publish -Prelease - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..adb3fe1 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk11 From ab7dc011c2630c4fae8cb1b67701891439fe7abb Mon Sep 17 00:00:00 2001 From: Eric Eilebrecht Date: Tue, 24 Oct 2023 10:06:28 -0700 Subject: [PATCH 2/2] Remove rest of old packaging scheme --- .github/workflows/build.yml | 4 +-- build.gradle.kts | 48 +++++++--------------------- collect/build.gradle.kts | 14 -------- detekt-treapability/build.gradle.kts | 8 ----- gradle.properties | 3 +- settings.gradle.kts | 2 ++ 6 files changed, 17 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee8923b..c5f64b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: Build with Gradle + - name: Build and Test with Gradle uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 with: - arguments: build + arguments: build publishToMavenLocal diff --git a/build.gradle.kts b/build.gradle.kts index c292f64..28e1c39 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,11 +9,16 @@ plugins { id("io.github.detekt.gradle.compiler-plugin") id("java-library") id("maven-publish") + id("pl.allegro.tech.build.axion-release") } subprojects { apply(plugin = "java-library") apply(plugin = "maven-publish") + apply(plugin = "pl.allegro.tech.build.axion-release") + + group = "com.github.certora.collections" + version = scmVersion.version repositories { mavenCentral() @@ -37,40 +42,11 @@ subprojects { } } - publishing { - publications { - repositories { - maven { - name = "GitHubPackages" - url = URI("https://maven.pkg.github.com/Certora/collections") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } - } - - withType { - version = if (project.hasProperty("release")) { - "${project.version}" - } else { - "${project.version}-SNAPSHOT" - } - - pom { - licenses { - license { - name.set("MIT License") - url.set("https://github.com/Certora/collections/blob/4bc9da2c8197aea0ed3ad8b32b5a3dbcd69e725e/LICENSE") - } - } - scm { - connection.set("scm:git:https://github.com/Certora/collections.git") - developerConnection.set("scm:git:ssh://github.com/Certora/collections.git") - url.set("https://github.com/Certora/collections/") - } - } - } - } - } + publishing { + publications { + create("maven") { + from(components["java"]) + } + } + } } diff --git a/collect/build.gradle.kts b/collect/build.gradle.kts index 1e6f055..aaf3dd7 100644 --- a/collect/build.gradle.kts +++ b/collect/build.gradle.kts @@ -17,20 +17,6 @@ detekt { config.setFrom("detekt.yml") } -publishing { - publications { - create("certora-collections") { - from(components["java"]) - - pom { - name.set("Certrora Collections") - description.set("Efficient collection types for Kotlin") - url.set("http://www.github.com/Certora/collections") - } - } - } -} - dependencies { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5") detektPlugins(project(":detekt-treapability")) diff --git a/detekt-treapability/build.gradle.kts b/detekt-treapability/build.gradle.kts index 30dd6d6..1c11862 100644 --- a/detekt-treapability/build.gradle.kts +++ b/detekt-treapability/build.gradle.kts @@ -14,14 +14,6 @@ tasks.withType { testLogging.showStandardStreams = true } -publishing { - publications { - create("certora-common-collections-detekt") { - from(components["java"]) - } - } -} - dependencies { val detektVersion: String by project val junitVersion: String by project diff --git a/gradle.properties b/gradle.properties index 054a249..a284b8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,5 @@ -group=com.certora -version=0.0.2 kotlinVersion=1.8.21 javaVersion=11 detektVersion=1.23.1 junitVersion=5.9.1 +axionVersion=1.15.5 diff --git a/settings.gradle.kts b/settings.gradle.kts index a9384da..b9f0672 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,10 +1,12 @@ pluginManagement { val kotlinVersion: String by settings val detektVersion: String by settings + val axionVersion: String by settings plugins { id("org.jetbrains.kotlin.jvm") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion id("io.github.detekt.gradle.compiler-plugin") version detektVersion + id("pl.allegro.tech.build.axion-release") version axionVersion } repositories { mavenCentral()