diff --git a/.github/workflows/publish-jar-file.yml b/.github/workflows/publish-jar-file.yml deleted file mode 100644 index 3853729b8f..0000000000 --- a/.github/workflows/publish-jar-file.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Jar file is useful for server code, so that the server code can depend on -# the TripleA client code (jar file). The TripleA client should include -# the 'http client' (AKA REST API) code for communicating with server -name: Publish Jar File -on: - push: - branches: - - master -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -jobs: - build: - runs-on: Ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v4 -# with: -# # Fetch depth of 0 is needed so we checkout the full revision history -# # The current revision count will be used as our build-number -# fetch-depth: '0' - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 11 - - name: set build version variables - run: | - BUILD_VERSION=$(game-app/run/.build/get-build-version) - echo "JAR_VERSION=$BUILD_VERSION" | tee -a $GITHUB_ENV - - name: Publish package - run: ./gradlew :game-app:game-headed:publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/upload-http-client-jars.yml b/.github/workflows/upload-http-client-jars.yml index 3328f5897a..454355d673 100644 --- a/.github/workflows/upload-http-client-jars.yml +++ b/.github/workflows/upload-http-client-jars.yml @@ -1,4 +1,4 @@ -# Jar files uploaded are used as a maven dependency by server +# Jar files uploaded are used as a maven dependency by server (eg: lobby) name: Create Http JAR files and upload to github packages on: push: @@ -18,7 +18,16 @@ jobs: # Fetch depth of 0 is needed so we checkout the full revision history # The current revision count will be used as our build-number fetch-depth: '0' - - name: Publish HTTP client JARs (used by servers) - run: ./gradlew publish + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + - name: set build version variables + run: | + BUILD_VERSION=$(game-app/run/.build/get-build-version) + echo "JAR_VERSION=$BUILD_VERSION" | tee -a $GITHUB_ENV + - name: Publish lobby client JAR + run: ./gradlew :http-clients:lobby-client:publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/game-app/game-headed/build.gradle b/game-app/game-headed/build.gradle index afca175ef9..64dccdc08a 100644 --- a/game-app/game-headed/build.gradle +++ b/game-app/game-headed/build.gradle @@ -7,7 +7,6 @@ plugins { archivesBaseName = "$group-$name" mainClassName = "org.triplea.game.client.HeadedGameRunner" -version = System.getenv("JAR_VERSION") ext { releasesDir = file("$buildDir/releases") @@ -44,24 +43,6 @@ jar { } } -publishing { - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/triplea-game/triplea") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } - } - publications { - shadow(MavenPublication) { publication -> - project.shadow.component(publication) - } - } -} - clean.doFirst { delete "$projectDir/.assets/" delete "$projectDir/assets/" diff --git a/http-clients/lobby-client/build.gradle b/http-clients/lobby-client/build.gradle index 6281c734b9..d69d6f53a0 100644 --- a/http-clients/lobby-client/build.gradle +++ b/http-clients/lobby-client/build.gradle @@ -3,6 +3,8 @@ plugins { id "com.github.johnrengelman.shadow" version "8.1.1" } +version = System.getenv("JAR_VERSION") + dependencies { implementation "io.github.openfeign:feign-core:$feignCoreVersion" implementation project(":game-app:domain-data") @@ -26,10 +28,6 @@ def getGitCommitCount = { -> return stdout.toString().trim() } -shadowJar { - version = "0." + getGitCommitCount() - archiveClassifier = "" -} publishing { repositories {