Skip to content

Commit 4e755ec

Browse files
committed
Add workflows
1 parent 42311b1 commit 4e755ec

File tree

6 files changed

+105
-1
lines changed

6 files changed

+105
-1
lines changed

.github/workflows/publish-main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Publish Main to https://maven.minecrafttas.com/main
2+
name: Publish Main
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'MinecraftTAS/BigArrayList'
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 23 for x64
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '23'
18+
distribution: 'temurin'
19+
architecture: x64
20+
- name: Setup Gradle
21+
uses: gradle/actions/setup-gradle@v3
22+
with:
23+
gradle-version: 8.13
24+
- name: Publish
25+
run: gradle publishAllPublicationsToMinecrafttasMainRepository -Prelease=true -PminecrafttasMainUsername=${{ secrets.MAVEN_NAME }} -PminecrafttasMainPassword=${{ secrets.MAVEN_SECRET }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Publish snapshot to https://maven.minecrafttas.com/snapshots
2+
name: Publish Snapshot
3+
4+
on: [push]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
if: github.repository == 'MinecraftTAS/BigArrayList'
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up JDK 23 for x64
13+
uses: actions/setup-java@v4
14+
with:
15+
java-version: '23'
16+
distribution: 'temurin'
17+
architecture: x64
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
with:
21+
gradle-version: 8.13
22+
- name: Publish
23+
run: gradle publishAllPublicationsToMinecrafttasSnapshotsRepository -PminecrafttasSnapshotsUsername=${{ secrets.MAVEN_NAME }} -PminecrafttasSnapshotsPassword=${{ secrets.MAVEN_SECRET }}

.github/workflows/report.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: report
2+
run-name: Upload Test Report
3+
on:
4+
workflow_run:
5+
workflows: [test]
6+
types: [completed]
7+
8+
permissions:
9+
contents: read
10+
actions: read
11+
checks: write
12+
jobs:
13+
report:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: dorny/[email protected]
17+
with:
18+
artifact: TestResult
19+
name: Tests
20+
path: '*.xml'
21+
reporter: java-junit

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 23 for x64
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '23'
18+
distribution: 'temurin'
19+
architecture: x64
20+
- name: Setup Gradle
21+
uses: gradle/actions/setup-gradle@v4
22+
with:
23+
gradle-version: 8.13
24+
- name: Build
25+
run: gradle build
26+
- name: Upload Test Report
27+
uses: actions/upload-artifact@v4
28+
if: always()
29+
with:
30+
name: TestResult
31+
path: build/test-results/test/*.xml
32+
retention-days: 1

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ plugins {
55
id 'maven-publish'
66
}
77

8-
version="1.5"
8+
def snapshot = project.release=="true" ? "" : "-SNAPSHOT"
9+
version = project.version+snapshot
910
group="com.dselent"
1011

1112
sourceCompatibility = targetCompatibility = 8

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=1.5
2+
release=false

0 commit comments

Comments
 (0)