Skip to content

Commit

Permalink
publish only via github
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Apr 30, 2024
1 parent a6e5eea commit d5a7907
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
build:
env:
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
REPOSITORY_USER: ${{ secrets.REPOSITORY_USER }}
REPOSITORY_PASSWORD: ${{ secrets.REPOSITORY_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,7 +20,7 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
- name: Publish with Gradle to Hangar
- name: Publish with Gradle to Hangar and Repository
uses: gradle/actions/setup-gradle@v3
with:
arguments: publishAllPublicationsToHangar
arguments: publish publishAllPublicationsToHangar
6 changes: 2 additions & 4 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ publishing {
val branch = if (version.toString().contains("-pre")) "snapshots" else "releases"
url = uri("https://repo.thenextlvl.net/$branch")
credentials {
if (extra.has("RELEASES_USER"))
username = extra["RELEASES_USER"].toString()
if (extra.has("RELEASES_PASSWORD"))
password = extra["RELEASES_PASSWORD"].toString()
username = System.getenv("REPOSITORY_USER")
password = System.getenv("REPOSITORY_PASSWORD")
}
}
}
4 changes: 1 addition & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
id.set("Worlds")
version.set(project.version as String)
channel.set(if (isRelease) "Release" else "Snapshot")
if (extra.has("HANGAR_API_TOKEN"))
apiKey.set(extra["HANGAR_API_TOKEN"] as String)
else apiKey.set(System.getenv("HANGAR_API_TOKEN"))
apiKey.set(System.getenv("HANGAR_API_TOKEN"))
platforms {
register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
Expand Down

0 comments on commit d5a7907

Please sign in to comment.