File tree Expand file tree Collapse file tree 5 files changed +64
-9
lines changed
build-logic/src/main/kotlin Expand file tree Collapse file tree 5 files changed +64
-9
lines changed Original file line number Diff line number Diff line change 1+ # This workflow uses actions that are not certified by GitHub.
2+ # They are provided by a third-party and are governed by
3+ # separate terms of service, privacy policy, and support
4+ # documentation.
5+ # This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+ # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+ name : Gradle Package
9+
10+ on :
11+ push :
12+ branches :
13+ - dev/3.0.0
14+
15+ jobs :
16+ build :
17+
18+ runs-on : ubuntu-latest
19+ permissions :
20+ contents : read
21+ packages : write
22+
23+ steps :
24+ - uses : actions/checkout@v4
25+ - name : Set up JDK 21
26+ uses : actions/setup-java@v4
27+ with :
28+ java-version : ' 21'
29+ distribution : ' temurin'
30+ server-id : github # Value of the distributionManagement/repository/id field of the pom.xml
31+ settings-path : ${{ github.workspace }} # location for the settings.xml file
32+
33+ - name : Setup Gradle
34+ uses : gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
36+ - name : Build with Gradle
37+ run : ./gradlew build
38+
39+ # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
40+ # the publishing section of your build.gradle
41+ - name : Publish to GitHub Packages
42+ run : ./gradlew publish
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -3,18 +3,24 @@ plugins {
33 `maven- publish`
44}
55
6+ val isCi = System .getenv(" GITHUB_EVENT_NAME" ) != null
7+
68extensions.configure<PublishingExtension > {
79 repositories {
8- maven {
9- credentials(PasswordCredentials ::class .java)
10-
11- name = if (version.toString().endsWith(" SNAPSHOT" )) " paperSnapshots" else " paper" // "paper" is seemingly not defined
12- val base = " https://artifactory.papermc.io/artifactory"
13- val releasesRepoUrl = " $base /releases/"
14- val snapshotsRepoUrl = " $base /snapshots/"
15- setUrl(if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl)
10+ if (isCi) {
11+ repositories {
12+ maven {
13+ name = " GitHubPackages"
14+ url = uri(" https://maven.pkg.github.com/poweredbyapartium/velocity" )
15+ credentials {
16+ username = System .getenv(" GITHUB_ACTOR" )
17+ password = System .getenv(" GITHUB_TOKEN" )
18+ }
19+ }
20+ }
1621 }
1722 }
23+
1824 publications {
1925 create<MavenPublication >(" maven" ) {
2026 from(components[" java" ])
Original file line number Diff line number Diff line change 1- group =com.velocitypowered
1+ group =dev.apartium.velocity
22version =3.4.0-SNAPSHOT
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ plugins {
66 id(" velocity-init-manifest" )
77 alias(libs.plugins.shadow)
88 alias(libs.plugins.fill)
9+ id(" velocity-publish" )
910}
1011
1112application {
Original file line number Diff line number Diff line change 1+ plugins {
2+ id(" velocity-publish" )
3+ }
4+
15dependencies {
26 implementation(libs.bundles.log4j)
37 annotationProcessor(libs.log4j.core)
You can’t perform that action at this time.
0 commit comments