From ab0bf5a13650271a8b0fc3cea7c1dd47b6e9d7d1 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 15:57:40 +0200 Subject: [PATCH 01/19] add publish configuration for github --- build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle b/build.gradle index 18fedd3..8c16e97 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,7 @@ plugins { id("org.ajoberstar.grgit") version("3.1.1") id("com.github.johnrengelman.shadow") version("4.0.4") id("com.palantir.git-version") version("0.12.3") + id("maven-publish") } apply plugin: 'forge' @@ -460,6 +461,20 @@ artifacts { } } +// publishing +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/octocat/hello-world" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + // Updating task updateBuildScript { doLast { From 48b397dc69cc3091a4efd4640bc9a99b9d1cb125 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:00:43 +0200 Subject: [PATCH 02/19] add artifact publish step to release process --- .github/workflows/release-tags.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 25c354b..639710e 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -43,3 +43,8 @@ jobs: prerelease: false title: "${{ env.RELEASE_VERSION }}" files: build/libs/*.jar + + - name: Publish package + run: gradle publish -Pgroup=com.github.GTNewHorizons -Pversion="${{ env.RELEASE_VERSION }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0979732423221976d638595366db2040ed871581 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:03:17 +0200 Subject: [PATCH 03/19] ci: test publishing --- .github/workflows/build-and-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a60a2b6..3a952d8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -43,3 +43,8 @@ jobs: run: | chmod +x .github/scripts/test-no-crash-reports.sh .github/scripts/test-no-crash-reports.sh + + - name: Publish package + run: gradle publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion=0.0.1-publish-test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 029275a7fc94f3ecd30aca41aa934f16b39ddd51 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:04:02 +0200 Subject: [PATCH 04/19] ci: use generic repository name for group --- .github/workflows/release-tags.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 639710e..e623984 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -45,6 +45,7 @@ jobs: files: build/libs/*.jar - name: Publish package - run: gradle publish -Pgroup=com.github.GTNewHorizons -Pversion="${{ env.RELEASE_VERSION }}" + run: gradle publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion="${{ env.RELEASE_VERSION }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From 1420dfb862baf4bda5ec82ddff204f9120f9f66f Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:10:34 +0200 Subject: [PATCH 05/19] cI: fix test publish --- .github/workflows/build-and-test.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3a952d8..d6ac117 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -33,18 +33,10 @@ jobs: - name: Build the mod run: ./gradlew build - - name: Run server for 1 minute - run: | - mkdir run - echo "eula=true" > run/eula.txt - timeout 60 ./gradlew runServer || true - - - name: Test no crashes happend - run: | - chmod +x .github/scripts/test-no-crash-reports.sh - .github/scripts/test-no-crash-reports.sh - - name: Publish package - run: gradle publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion=0.0.1-publish-test + run: ./gradlew publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion=0.0.1-publish-test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + From 5c23b1d012509a2fdc74617022fcc35734d4e682 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:10:56 +0200 Subject: [PATCH 06/19] ci: use wrapper when publishing tag --- .github/workflows/release-tags.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index e623984..2d88fcd 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -45,7 +45,7 @@ jobs: files: build/libs/*.jar - name: Publish package - run: gradle publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion="${{ env.RELEASE_VERSION }}" + run: ./gradlew publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion="${{ env.RELEASE_VERSION }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7f4a949b6e9229302ddf0a4a5341d5a8babc65db Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:14:52 +0200 Subject: [PATCH 07/19] make github maven url adjustable for workflow --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8c16e97..313296e 100644 --- a/build.gradle +++ b/build.gradle @@ -464,9 +464,11 @@ artifacts { // publishing publishing { repositories { + String owner = System.getenv("REPOSITORY_OWNER") + String repositoryName = System.getenv("REPOSITORY_OWNER") maven { name = "GitHubPackages" - url = "https://maven.pkg.github.com/octocat/hello-world" + url = "https://maven.pkg.github.com/$owner/$repositoryName" credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") From 4cc9b116829d6a1acf6fb9d35f84c98068bdc2fe Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:15:17 +0200 Subject: [PATCH 08/19] fix typo --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 313296e..8511ff2 100644 --- a/build.gradle +++ b/build.gradle @@ -465,7 +465,7 @@ artifacts { publishing { repositories { String owner = System.getenv("REPOSITORY_OWNER") - String repositoryName = System.getenv("REPOSITORY_OWNER") + String repositoryName = System.getenv("REPOSITORY_NAME") maven { name = "GitHubPackages" url = "https://maven.pkg.github.com/$owner/$repositoryName" From 02b223347d3a5eac826810c7a3f26439d3e01468 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:18:23 +0200 Subject: [PATCH 09/19] ci: provide repository owner and name on publishing --- .github/workflows/release-tags.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 2d88fcd..651d7a4 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -45,7 +45,9 @@ jobs: files: build/libs/*.jar - name: Publish package - run: ./gradlew publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion="${{ env.RELEASE_VERSION }}" + run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion="${{ env.RELEASE_VERSION }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY_NAME: ${GITHUB_REPOSITORY#*/} + REPOISITORY_OWNER: ${GITHUB_REPOSITORY%/*} From 2b14550d8f3bb639f2c53be34cc40974ddd1e517 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:19:11 +0200 Subject: [PATCH 10/19] fix test publish --- .github/workflows/build-and-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d6ac117..ca87c16 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -34,9 +34,10 @@ jobs: run: ./gradlew build - name: Publish package - run: ./gradlew publish -Pgroup=com.github."${GITHUB_REPOSITORY%/*}" -Pversion=0.0.1-publish-test + run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion=0.0.1-publish-test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + REPOSITORY_NAME: ${GITHUB_REPOSITORY#*/} + REPOISITORY_OWNER: ${GITHUB_REPOSITORY%/*} From f7da5918770bcd7198a0e6803210f15aebce88b7 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:29:22 +0200 Subject: [PATCH 11/19] buildscript: add check for ci environment when adding github maven packages configuration --- build.gradle | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 8511ff2..b6d682e 100644 --- a/build.gradle +++ b/build.gradle @@ -463,18 +463,26 @@ artifacts { // publishing publishing { - repositories { - String owner = System.getenv("REPOSITORY_OWNER") - String repositoryName = System.getenv("REPOSITORY_NAME") - maven { - name = "GitHubPackages" - url = "https://maven.pkg.github.com/$owner/$repositoryName" - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } + repositories { + String owner = System.getenv("REPOSITORY_OWNER") + String repositoryName = System.getenv("REPOSITORY_NAME") + String githubUser = System.getenv("GITHUB_ACTOR") + String githubToken = System.getenv("GITHUB_TOKEN") + boolean isInGithubCIEnvironment = owner != null && repositoryName != null && githubUser != null && githubToken != null + + if (isInGithubCIEnvironment) { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/$owner/$repositoryName" + credentials { + username = githubUser + password = githubToken + } + } + } else { + print("Assuming not being in CI environment: skipping github publishing configuration") + } } - } } // Updating From 5e3126770e157dfcd9c6a1634deb475ccd9af690 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:37:34 +0200 Subject: [PATCH 12/19] ci: fix typo --- .github/workflows/build-and-test.yml | 9 +++++++-- .github/workflows/release-tags.yml | 13 +++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ca87c16..9ab9906 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -33,11 +33,16 @@ jobs: - name: Build the mod run: ./gradlew build + - name: Set repository owner and name + run: | + echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} >> $GITHUB_ENV + - name: Publish package run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion=0.0.1-publish-test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPOSITORY_NAME: ${GITHUB_REPOSITORY#*/} - REPOISITORY_OWNER: ${GITHUB_REPOSITORY%/*} + REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" + REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 651d7a4..aefe999 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -44,10 +44,15 @@ jobs: title: "${{ env.RELEASE_VERSION }}" files: build/libs/*.jar + - name: Set repository owner and name + run: | + echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} >> $GITHUB_ENV + - name: Publish package - run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion="${{ env.RELEASE_VERSION }}" + run: ./gradlew publish -Pgroup=com.github."$REPOSITORY_OWNER" -Pversion="$VERSION" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPOSITORY_NAME: ${GITHUB_REPOSITORY#*/} - REPOISITORY_OWNER: ${GITHUB_REPOSITORY%/*} - + REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" + REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" + VERSION: "${{ env.RELEASE_VERSION }}" From fae84dcbe012b306389f75d75f6508979dae03e9 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:41:56 +0200 Subject: [PATCH 13/19] ci: fix typo --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/release-tags.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9ab9906..39cf86f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -36,7 +36,7 @@ jobs: - name: Set repository owner and name run: | echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV - echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Publish package run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion=0.0.1-publish-test diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index aefe999..3502d97 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -47,7 +47,7 @@ jobs: - name: Set repository owner and name run: | echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV - echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Publish package run: ./gradlew publish -Pgroup=com.github."$REPOSITORY_OWNER" -Pversion="$VERSION" From 1d64f1f1a416754bc23ebc4977587355b736f3e8 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:54:06 +0200 Subject: [PATCH 14/19] buildscript: fix publishing section --- build.gradle | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index b6d682e..4ec3084 100644 --- a/build.gradle +++ b/build.gradle @@ -464,23 +464,16 @@ artifacts { // publishing publishing { repositories { - String owner = System.getenv("REPOSITORY_OWNER") - String repositoryName = System.getenv("REPOSITORY_NAME") - String githubUser = System.getenv("GITHUB_ACTOR") - String githubToken = System.getenv("GITHUB_TOKEN") - boolean isInGithubCIEnvironment = owner != null && repositoryName != null && githubUser != null && githubToken != null - - if (isInGithubCIEnvironment) { - maven { - name = "GitHubPackages" - url = "https://maven.pkg.github.com/$owner/$repositoryName" - credentials { - username = githubUser - password = githubToken - } + maven { + String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" + String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown" + String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName" + name = "GitHubPackages" + url = githubRepositoryUrl + credentials { + username = System.getenv("GITHUB_ACTOR") ?: "NONE" + password = System.getenv("GITHUB_TOKEN") ?: "NONE" } - } else { - print("Assuming not being in CI environment: skipping github publishing configuration") } } } From 1d3fa3795e5dfcbd33e6d39d8f732b960875f1a7 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:00:34 +0200 Subject: [PATCH 15/19] buildscript: add publication to publishing --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 4ec3084..06c643b 100644 --- a/build.gradle +++ b/build.gradle @@ -463,6 +463,17 @@ artifacts { // publishing publishing { + publications { + maven(MavenPublication) { + from components.java + artifact source: sourcesJar, classifier: "src" + artifact source: devJar, classifier: "dev" + if (apiPackage) { + archives source: apiJar, classifier: "api" + } + } + } + repositories { maven { String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" From e17120f9b398187b528594c18ae19ca0f4cc1b2c Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:01:36 +0200 Subject: [PATCH 16/19] buildscript: add jar as artifact --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 06c643b..cdbcee9 100644 --- a/build.gradle +++ b/build.gradle @@ -465,7 +465,7 @@ artifacts { publishing { publications { maven(MavenPublication) { - from components.java + artifact source: jar artifact source: sourcesJar, classifier: "src" artifact source: devJar, classifier: "dev" if (apiPackage) { From 659ad055d4c5d5221c1d62b83c9e58607f21b848 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:09:06 +0200 Subject: [PATCH 17/19] buildscript: configure publication with correct parameters --- .github/workflows/build-and-test.yml | 5 ++++- .github/workflows/release-tags.yml | 8 +++++--- build.gradle | 4 ++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 39cf86f..2ac0180 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -39,9 +39,12 @@ jobs: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Publish package - run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion=0.0.1-publish-test + run: ./gradlew publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GROUP_ID: com.github.${{ env.REPOSITORY_NAME }} + ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_VERSION: "0.0.1-publish-test" REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 3502d97..ea5846a 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -50,9 +50,11 @@ jobs: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Publish package - run: ./gradlew publish -Pgroup=com.github."$REPOSITORY_OWNER" -Pversion="$VERSION" + run: ./gradlew publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" - VERSION: "${{ env.RELEASE_VERSION }}" + GROUP_ID: com.github.${{ env.REPOSITORY_NAME }} + REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}" diff --git a/build.gradle b/build.gradle index cdbcee9..4f52b8f 100644 --- a/build.gradle +++ b/build.gradle @@ -471,6 +471,10 @@ publishing { if (apiPackage) { archives source: apiJar, classifier: "api" } + + groupId = System.getenv("GROUP_ID") ?: group + artifactId = System.getenv("ARTIFACT_NAME") ?: project.name + version = System.getenv("ARTIFACT_VERSION") ?: project.version } } From 5af85c307d036541f712b236d5a209fa49d7fdd3 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:20:27 +0200 Subject: [PATCH 18/19] buildscript: fix artifact id and group id being incorrect --- .github/workflows/build-and-test.yml | 4 ++-- build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2ac0180..9e4ee82 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -42,8 +42,8 @@ jobs: run: ./gradlew publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GROUP_ID: com.github.${{ env.REPOSITORY_NAME }} - ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }} + ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}" ARTIFACT_VERSION: "0.0.1-publish-test" REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" diff --git a/build.gradle b/build.gradle index 4f52b8f..6b58fb0 100644 --- a/build.gradle +++ b/build.gradle @@ -472,8 +472,8 @@ publishing { archives source: apiJar, classifier: "api" } - groupId = System.getenv("GROUP_ID") ?: group - artifactId = System.getenv("ARTIFACT_NAME") ?: project.name + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group + artifactId = System.getenv("ARTIFACT_ID") ?: project.name version = System.getenv("ARTIFACT_VERSION") ?: project.version } } From 2c72a3924d91f45d541dd83f1f83ddc550e4fa09 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:29:40 +0200 Subject: [PATCH 19/19] ci: update publishing in release-tags.yml workflow; revert build-and-test.yml --- .github/workflows/build-and-test.yml | 24 +++++++++--------------- .github/workflows/release-tags.yml | 9 +++++---- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9e4ee82..10efffe 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -29,23 +29,17 @@ jobs: - name: Setup the workspace run: ./gradlew setupCIWorkspace - + - name: Build the mod run: ./gradlew build - - name: Set repository owner and name + - name: Run server for 1 minute run: | - echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV - echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - - - name: Publish package - run: ./gradlew publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }} - ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}" - ARTIFACT_VERSION: "0.0.1-publish-test" - REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" - REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" - + mkdir run + echo "eula=true" > run/eula.txt + timeout 60 ./gradlew runServer || true + - name: Test no crashes happend + run: | + chmod +x .github/scripts/test-no-crash-reports.sh + .github/scripts/test-no-crash-reports.sh diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index ea5846a..96d37f7 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -53,8 +53,9 @@ jobs: run: ./gradlew publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" - GROUP_ID: com.github.${{ env.REPOSITORY_NAME }} - REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" - ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}" + ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }} + ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}" ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}" + REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" + REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" +