Skip to content

Commit

Permalink
Leverage existing JAR publish of existing http-client subproject (#12620
Browse files Browse the repository at this point in the history
)

This update unifies the newly added JAR publish config with the existing
config.

I did not realize we already published jars, hence the need to unify
config that does about the same. Even better, the existing mechanism
only publishes the 'http-client' JAR, which is exactly
(and no more than) what we need for a server dependency.
  • Loading branch information
DanVanAtta authored Jun 6, 2024
1 parent 0154021 commit 598b4cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 59 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/publish-jar-file.yml

This file was deleted.

15 changes: 12 additions & 3 deletions .github/workflows/upload-http-client-jars.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
19 changes: 0 additions & 19 deletions game-app/game-headed/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {

archivesBaseName = "$group-$name"
mainClassName = "org.triplea.game.client.HeadedGameRunner"
version = System.getenv("JAR_VERSION")

ext {
releasesDir = file("$buildDir/releases")
Expand Down Expand Up @@ -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/"
Expand Down
6 changes: 2 additions & 4 deletions http-clients/lobby-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -26,10 +28,6 @@ def getGitCommitCount = { ->
return stdout.toString().trim()
}

shadowJar {
version = "0." + getGitCommitCount()
archiveClassifier = ""
}

publishing {
repositories {
Expand Down

0 comments on commit 598b4cf

Please sign in to comment.