From 1aeb59f52ec142aa2587232411197ad1b90e1314 Mon Sep 17 00:00:00 2001 From: nsenave Date: Fri, 19 Jul 2024 15:13:43 +0200 Subject: [PATCH 1/7] ci(release): try with group and version in module --- .github/workflows/release.yaml | 30 +++++++++++++++--------------- model/build.gradle.kts | 3 +++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 906e22d..e5f731a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -80,18 +80,18 @@ jobs: GPG_SIGNING_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - create-release: - needs: [check-version, publish] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Create GitHub release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ needs.check-version.outputs.release-version }} - target_commitish: ${{ github.head_ref || github.ref }} - name: ${{ needs.check-version.outputs.release-version }} - files: eno-ws/build/libs/eno-ws.jar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# create-release: +# needs: [check-version, publish] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# +# - name: Create GitHub release +# uses: softprops/action-gh-release@v1 +# with: +# tag_name: ${{ needs.check-version.outputs.release-version }} +# target_commitish: ${{ github.head_ref || github.ref }} +# name: ${{ needs.check-version.outputs.release-version }} +# files: eno-ws/build/libs/eno-ws.jar +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/model/build.gradle.kts b/model/build.gradle.kts index 99d44ec..5303c86 100644 --- a/model/build.gradle.kts +++ b/model/build.gradle.kts @@ -15,6 +15,9 @@ java { withSourcesJar() } +group = "fr.insee.ddi" +version = "1.1.0" + val nameForArtifactAndJar by extra("ddi-lifecycle") repositories { From 74922c9ee8513f3c0cf34baefc6e063b2af575a7 Mon Sep 17 00:00:00 2001 From: nsenave Date: Fri, 19 Jul 2024 15:14:08 +0200 Subject: [PATCH 2/7] remove main branch condition --- .github/workflows/release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e5f731a..2adb5c4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,6 @@ env: jobs: check-version: - if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest outputs: release-version: ${{ steps.version-step.outputs.version }} From a7bbdd2630dadaa3756e7232baaecb59a9b1af9b Mon Sep 17 00:00:00 2001 From: nsenave Date: Fri, 19 Jul 2024 23:11:25 +0200 Subject: [PATCH 3/7] group and version at root --- build.gradle.kts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a7aeb0b..a057a66 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,10 +2,8 @@ plugins { id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } -allprojects { - group = "fr.insee.ddi" - version = "1.1.0" -} +group = "fr.insee.ddi" +version = "1.1.0" tasks.register("printVersion") { doLast { From 080fa9f6744d4e153444eddc509fc1fcdc6fca6c Mon Sep 17 00:00:00 2001 From: nsenave Date: Fri, 19 Jul 2024 23:19:48 +0200 Subject: [PATCH 4/7] try with gradle build action --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2adb5c4..5c9fc6b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -68,7 +68,7 @@ jobs: gpg-passphrase: GPG_PASSWORD - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/gradle-build-action@v3 - name: Publish DDI Lifecycle lib on Maven Central run: | From 9b9c09da8e284f499e9874707d6f058f50f7d502 Mon Sep 17 00:00:00 2001 From: nsenave Date: Sat, 20 Jul 2024 01:10:25 +0200 Subject: [PATCH 5/7] restore gradle build --- build.gradle.kts | 6 ++++-- model/build.gradle.kts | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a057a66..a7aeb0b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,8 +2,10 @@ plugins { id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } -group = "fr.insee.ddi" -version = "1.1.0" +allprojects { + group = "fr.insee.ddi" + version = "1.1.0" +} tasks.register("printVersion") { doLast { diff --git a/model/build.gradle.kts b/model/build.gradle.kts index 5303c86..99d44ec 100644 --- a/model/build.gradle.kts +++ b/model/build.gradle.kts @@ -15,9 +15,6 @@ java { withSourcesJar() } -group = "fr.insee.ddi" -version = "1.1.0" - val nameForArtifactAndJar by extra("ddi-lifecycle") repositories { From b8b0d90fd536813cc1b75aea2f72b22f0b93c7ca Mon Sep 17 00:00:00 2001 From: nsenave Date: Sat, 20 Jul 2024 01:11:18 +0200 Subject: [PATCH 6/7] ci(gradle): use gradle-build-action for now --- .github/workflows/release.yaml | 32 +++++++++++++++++--------------- .github/workflows/snapshot.yaml | 4 +++- .github/workflows/test.yaml | 2 +- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c9fc6b..d138b5d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -69,6 +69,8 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v3 + # Note: the action recommends to switch to gradle/actions/setup-gradle@v3 + # but this change makes the publish task fail at initialization of stating repository. - name: Publish DDI Lifecycle lib on Maven Central run: | @@ -79,18 +81,18 @@ jobs: GPG_SIGNING_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSPHRASE }} -# create-release: -# needs: [check-version, publish] -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# -# - name: Create GitHub release -# uses: softprops/action-gh-release@v1 -# with: -# tag_name: ${{ needs.check-version.outputs.release-version }} -# target_commitish: ${{ github.head_ref || github.ref }} -# name: ${{ needs.check-version.outputs.release-version }} -# files: eno-ws/build/libs/eno-ws.jar -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + create-release: + needs: [check-version, publish] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.check-version.outputs.release-version }} + target_commitish: ${{ github.head_ref || github.ref }} + name: ${{ needs.check-version.outputs.release-version }} + files: eno-ws/build/libs/eno-ws.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index f4c04db..94210c3 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -24,7 +24,9 @@ jobs: java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/gradle-build-action@v3 + # Note: the action recommends to switch to gradle/actions/setup-gradle@v3 + # but this change makes the publish task fail at initialization of stating repository. - name: Get DDI-Lifecycle lib version id: version-step diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 886a4d6..aece19b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,7 +25,7 @@ jobs: java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/gradle-build-action@v3 # Use this action here while it's still use in publishing workflows. - name: DDI Lifecycle lib tests run: | From 34157ee25de72750c76a3539b303eedb6ca5a9a2 Mon Sep 17 00:00:00 2001 From: nsenave Date: Sat, 20 Jul 2024 01:12:27 +0200 Subject: [PATCH 7/7] restore main branch condition --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d138b5d..1381cb5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,7 @@ env: jobs: check-version: + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest outputs: release-version: ${{ steps.version-step.outputs.version }}