Skip to content

Commit 1dc8a34

Browse files
authored
Merge pull request #544 from danthe1st/maven
Switch to Maven
2 parents 0f818bf + b13e3d6 commit 1dc8a34

File tree

14 files changed

+258
-522
lines changed

14 files changed

+258
-522
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a Java project with Gradle
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
41
name: Build JavaBot
52

63
on: [push, pull_request, workflow_dispatch]
@@ -11,33 +8,49 @@ jobs:
118
permissions:
129
contents: read
1310
steps:
14-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v6
1512
- name: Set up JDK 25
16-
uses: actions/setup-java@v4
13+
uses: actions/setup-java@v5
1714
with:
1815
java-version: '25'
16+
cache: 'maven'
1917
distribution: 'temurin'
20-
- name: Grant execute permission for gradlew
21-
run: chmod +x gradlew
22-
- name: Build with Gradle
23-
run: ./gradlew build
24-
- name: Test with Gradle
25-
run: ./gradlew test
18+
- name: Build and run tests
19+
run: mvn verify
20+
nativetest:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v6
26+
- name: Set up JDK 25
27+
uses: graalvm/setup-graalvm@v1
28+
with:
29+
java-version: '25'
30+
distribution: 'graalvm-community'
31+
cache: 'maven'
32+
- name: Run tests with native-image
33+
run: mvn test -PnativeTest
2634
publish:
2735
runs-on: ubuntu-latest
2836
permissions:
2937
contents: read
30-
needs: build
38+
needs:
39+
- build
3140
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' }}
41+
concurrency:
42+
group: publish
43+
cancel-in-progress: true
3244
steps:
33-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v6
3446
- name: Set up JDK 25
3547
uses: graalvm/setup-graalvm@v1
3648
with:
3749
java-version: '25'
3850
distribution: 'graalvm-community'
51+
cache: 'maven'
3952
- name: Build native-image
40-
run: ./gradlew nativeCompile -Pprod
53+
run: "mvn native:compile -Pnative -Pprod '-P!dev'"
4154
- name: Build Docker image
4255
run: docker build -t javabot .
4356
- name: Tag docker image
@@ -48,7 +61,7 @@ jobs:
4861
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
4962
if: env.dockerhub_username != null
5063
- name: Login to DockerHub
51-
uses: docker/login-action@v3
64+
uses: docker/login-action@v4
5265
with:
5366
username: ${{ secrets.DOCKERHUB_USERNAME }}
5467
password: ${{ secrets.DOCKERHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ build/
77
/purgeArchives
88
/logs
99
/db
10-
10+
/target/
1111
# Eclipse settings
1212
.classpath
1313
.project
1414
.settings/
1515
bin/
16+
/.factorypath
1617

1718
# H2 Database
1819
*.mv.db

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM alpine:latest
22
RUN apk add --no-cache libsm libxrender libxext libxtst libxi gcompat ttf-dejavu
33

4-
COPY build/native/nativeCompile /work
4+
COPY target/*.so /work/
5+
COPY target/javabot /work/
56
WORKDIR /work
67

78
RUN chown 1000:1000 /work

build.gradle.kts

Lines changed: 0 additions & 131 deletions
This file was deleted.

checkstyle/suppressions.xml

Whitespace-only changes.

gradle/wrapper/gradle-wrapper.jar

-42.7 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)