Skip to content

Commit a8fe7f4

Browse files
authored
Merge pull request #92 from adf-python/feature/java-github-package
feat:add java's github package ci/cd
2 parents 95a7020 + 58e2d67 commit a8fe7f4

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,22 @@ jobs:
122122

123123
- name: Run pytest
124124
run: pytest tests/
125+
126+
publish:
127+
runs-on: ubuntu-latest
128+
permissions:
129+
contents: read
130+
packages: write
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: actions/setup-java@v4
134+
with:
135+
java-version: '17'
136+
distribution: 'temurin'
137+
- name: Setup Gradle
138+
uses: gradle/actions/setup-gradle@v3
139+
140+
- name: Publish package
141+
run: cd java && ./gradlew publish
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

java/lib/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id('java-library')
33
id('com.google.protobuf') version "0.9.4"
4+
id('maven-publish')
45
}
56

67
repositories {
@@ -51,3 +52,16 @@ java {
5152
tasks.named('test') {
5253
useJUnitPlatform()
5354
}
55+
56+
publishing {
57+
repositories {
58+
maven {
59+
name = "GitHubPackages"
60+
url = "https://maven.pkg.github.com/adf-python/adf-core-python"
61+
credentials {
62+
username = System.getenv("GITHUB_ACTOR")
63+
password = System.getenv("GITHUB_TOKEN")
64+
}
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)