File tree Expand file tree Collapse file tree 3 files changed +44
-52
lines changed
Expand file tree Collapse file tree 3 files changed +44
-52
lines changed Original file line number Diff line number Diff line change 2424 distribution : ' temurin'
2525
2626 - name : Build with Gradle
27- run : ./gradlew build
27+ run : ./gradlew build
28+
29+ - name : Upload JAR file
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : Artifacts
33+ path : build/libs/*.jar
34+
35+ - name : Publish
36+ if : github.ref == 'refs/heads/main' && github.repository_owner == 'SuperCrafting'
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+ GITHUB_USERNAME : ${{ github.repository_owner }}
40+ GITHUB_REPOSITORY : ${{ github.repository }}
41+ BUILD_VERSION : ${{ github.run_number }}
42+ run : ./gradlew publish
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11plugins {
22 id ' java'
3+ id ' maven-publish'
34}
45
56group = ' pt.supercrafting.menu'
@@ -28,4 +29,31 @@ dependencies {
2829
2930test {
3031 useJUnitPlatform()
32+ }
33+
34+ publishing {
35+
36+ publications {
37+ maven(MavenPublication ) {
38+ groupId = project. group
39+ artifactId = ' menu-api'
40+ version = project. version
41+
42+ from components. java
43+ }
44+ }
45+
46+ repositories {
47+ maven {
48+ credentials {
49+ username System . getenv(' GITHUB_USERNAME' )
50+ password System . getenv(' GITHUB_TOKEN' )
51+ }
52+ name = " menu-api"
53+
54+ String owner = System . getenv(' GITHUB_USERNAME' )
55+ String repository = System . getenv(' GITHUB_REPOSITORY' ) ?: ' menu-api'
56+ url = " https://maven.pkg.github.com/" + owner " /" + repository
57+ }
58+ }
3159}
You can’t perform that action at this time.
0 commit comments