Skip to content

Commit

Permalink
Release Java package on build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oluiscabral committed Oct 31, 2024
1 parent 56343b4 commit fe16efd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
run: gradle test
working-directory: ./java

- name: Publish Java release
run: gradle publish
working-directory: ./java
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

windows:
name: Test on Windows
runs-on: windows-latest
Expand Down Expand Up @@ -84,6 +90,12 @@ jobs:
run: gradle test
working-directory: ./java

- name: Publish Java release
run: gradle publish
working-directory: ./java
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

mac-intel:
name: Test on macOS Intel
runs-on: macos-14
Expand Down Expand Up @@ -112,3 +124,9 @@ jobs:
- name: Java tests
run: gradle test
working-directory: ./java

- name: Publish Java release
run: gradle publish
working-directory: ./java
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions java/lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
// Apply the java-library plugin for API and implementation separation.
`java-library`
`maven-publish`
}

repositories {
Expand Down Expand Up @@ -40,3 +41,16 @@ tasks.named<Javadoc>("javadoc") {
options.encoding = "UTF-8"
options.memberLevel = JavadocMemberLevel.PUBLIC
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ARK-Builders/ark-core")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit fe16efd

Please sign in to comment.