Skip to content

Commit 3d6625b

Browse files
committed
Add GitHub Actions workflow for publishing JAR to Maven
1 parent 1aca756 commit 3d6625b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish JAR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v3
19+
with:
20+
distribution: 'temurin'
21+
java-version: '21'
22+
23+
- name: Build with Gradle
24+
run: ./gradlew build
25+
26+
- name: Publish to Maven
27+
run: ./gradlew publish
28+
env:
29+
ONELITEFEATHER_MAVEN_USERNAME: ${{ secrets.ONELITEFEATHER_MAVEN_USERNAME }}
30+
ONELITEFEATHER_MAVEN_PASSWORD: ${{ secrets.ONELITEFEATHER_MAVEN_PASSWORD }}

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ publishing {
3232
} else {
3333
uri("https://repo.onelitefeather.dev/onelitefeather-releases")
3434
}
35+
credentials {
36+
username = System.getenv("ONELITEFEATHER_MAVEN_USERNAME")
37+
password = System.getenv("ONELITEFEATHER_MAVEN_PASSWORD")
38+
}
3539
credentials(PasswordCredentials::class)
3640
authentication {
3741
create<BasicAuthentication>("basic")

0 commit comments

Comments
 (0)