Skip to content

Commit 6adb88a

Browse files
Build: Add GitHub Actions
1 parent 4ff2ea7 commit 6adb88a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build & Publish
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-java@v4
14+
with:
15+
distribution: temurin
16+
java-version: |
17+
8
18+
16
19+
17
20+
21
21+
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.gradle/wrapper
25+
key: gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
26+
27+
- uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
**/loom-cache
32+
key: gradle-caches-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle.properties', 'gradle/*.versions.toml') }}
33+
restore-keys: |
34+
gradle-caches-${{ hashFiles('**/*.gradle*') }}
35+
gradle-caches-
36+
37+
- name: Build
38+
run: ./gradlew build --stacktrace
39+
40+
- name: Publish
41+
if: startsWith(github.ref, 'refs/tags/v') # eg, v1.0.0
42+
run: ./gradlew publish --stacktrace
43+
env:
44+
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
45+
ORG_GRADLE_PROJECT_nexus_password: ${{ secrets.NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)