Skip to content

Commit 3bfd55f

Browse files
committed
Update build
1 parent 9ca5c87 commit 3bfd55f

2 files changed

Lines changed: 75 additions & 42 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
1-
name: Build and Archive
1+
name: Build
22

33
on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: build-${{ github.ref }}
11+
cancel-in-progress: true
712

813
jobs:
914
build:
1015
runs-on: ubuntu-latest
1116

1217
steps:
1318
- name: Checkout repository
14-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1520

1621
- name: Set up JDK
17-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v4
1823
with:
19-
distribution: "temurin"
24+
distribution: temurin
2025
java-version: "21"
2126

27+
- name: Set up Gradle
28+
uses: gradle/actions/setup-gradle@v4
29+
2230
- name: Make gradlew executable
2331
run: chmod +x gradlew
2432

2533
- name: Build with Gradle
26-
run: ./gradlew build
34+
run: ./gradlew clean build --no-daemon
35+
36+
- name: Collect release artifacts
37+
run: |
38+
mkdir -p dist
39+
find modules -path "*/build/libs/*.jar" \
40+
! -name "*-sources.jar" \
41+
! -name "*-thin.jar" \
42+
! -path "*/core/build/libs/*" \
43+
-exec cp {} dist/ \;
2744
2845
- name: Archive artifacts
2946
uses: actions/upload-artifact@v4
3047
with:
31-
name: geyser-voice-artifacts
32-
path: |
33-
modules/paper/build/libs/
34-
modules/velocity/build/libs/
35-
modules/bungeecord/build/libs/
48+
name: geyservoice-build
49+
path: dist/*.jar
50+
if-no-files-found: error

.github/workflows/release.yml

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,56 @@ on:
99
status:
1010
required: true
1111
description: "Status (beta, stable)"
12+
publish_modrinth:
13+
required: true
14+
description: "Publish to Modrinth"
15+
default: "true"
1216

1317
env:
1418
VERSION: ${{ github.event.inputs.tag }}-${{ github.event.inputs.status }}
1519

20+
concurrency:
21+
group: release-${{ github.event.inputs.tag }}
22+
cancel-in-progress: false
23+
1624
jobs:
1725
build:
1826
runs-on: ubuntu-latest
1927

2028
steps:
2129
- name: Checkout repository
22-
uses: actions/checkout@v2
30+
uses: actions/checkout@v4
2331

2432
- name: Set up JDK
25-
uses: actions/setup-java@v2
33+
uses: actions/setup-java@v4
2634
with:
27-
distribution: "temurin"
35+
distribution: temurin
2836
java-version: "21"
2937

38+
- name: Set up Gradle
39+
uses: gradle/actions/setup-gradle@v4
40+
3041
- name: Make gradlew executable
3142
run: chmod +x gradlew
3243

3344
- name: Build with Gradle
34-
run: ./gradlew build -PVERSION="${{ env.VERSION }}"
45+
run: ./gradlew clean build -PVERSION="${{ env.VERSION }}" --no-daemon
46+
47+
- name: Collect release artifacts
48+
run: |
49+
mkdir -p release-artifacts
50+
find modules -path "*/build/libs/*.jar" \
51+
! -name "*-sources.jar" \
52+
! -name "*-thin.jar" \
53+
! -path "*/core/build/libs/*" \
54+
-exec cp {} release-artifacts/ \;
3555
3656
- name: Archive artifacts
3757
uses: actions/upload-artifact@v4
3858
with:
39-
name: geyser-voice-artifacts
40-
path: |
41-
modules/paper/build/libs/
42-
modules/velocity/build/libs/
43-
modules/bungeecord/build/libs/
59+
name: geyservoice-release
60+
path: release-artifacts/*.jar
61+
if-no-files-found: error
4462

4563
publish_release:
4664
name: Publish release
@@ -52,47 +70,47 @@ jobs:
5270

5371
steps:
5472
- name: Checkout repository
55-
uses: actions/checkout@v2
73+
uses: actions/checkout@v4
5674

5775
- name: Download artifacts
5876
uses: actions/download-artifact@v4
5977
with:
60-
name: geyser-voice-artifacts
61-
path: release-artifacts/
78+
name: geyservoice-release
79+
path: release-artifacts
6280

6381
- name: Create release
6482
if: github.event.inputs.status == 'stable'
65-
uses: ncipollo/release-action@v1.13.0
83+
uses: ncipollo/release-action@v1.14.0
6684
with:
6785
prerelease: false
6886
tag: ${{ github.event.inputs.tag }}
69-
artifacts: |
70-
release-artifacts/**/*.jar
71-
env:
72-
GITHUB_REPOSITORY: AvionBlock/GeyserVoice
87+
artifacts: release-artifacts/*.jar
88+
artifactErrorsFailBuild: true
89+
allowUpdates: true
90+
replacesArtifacts: true
7391

7492
- name: Create pre-release
7593
if: github.event.inputs.status != 'stable'
76-
uses: ncipollo/release-action@v1.13.0
94+
uses: ncipollo/release-action@v1.14.0
7795
with:
7896
prerelease: true
7997
tag: ${{ github.event.inputs.tag }}
80-
artifacts: |
81-
release-artifacts/**/*.jar
82-
env:
83-
GITHUB_REPOSITORY: AvionBlock/GeyserVoice
98+
artifacts: release-artifacts/*.jar
99+
artifactErrorsFailBuild: true
100+
allowUpdates: true
101+
replacesArtifacts: true
84102

85103
- name: Create Modrinth release
104+
if: github.event.inputs.publish_modrinth == 'true'
86105
uses: dsx137/modrinth-release-action@main
87106
env:
88-
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
107+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
89108
with:
90-
name: GeyserVoice ${{ github.event.inputs.tag }}
91-
project_id: WtPu56Wa
92-
loaders: paper, purpur, velocity, bungeecord
93-
game_versions: 1.20.2:1.21.10
94-
version_number: ${{ github.event.inputs.tag }}
95-
featured: ${{ github.event.inputs.status == 'stable' }}
96-
version_type: ${{ github.event.inputs.status == 'stable' && 'release' || 'beta' }}
97-
files: |
98-
./release-artifacts/**/*.jar
109+
name: GeyserVoice ${{ github.event.inputs.tag }}
110+
project_id: WtPu56Wa
111+
loaders: paper, purpur, velocity, bungeecord
112+
game_versions: 1.21.11:26.1
113+
version_number: ${{ github.event.inputs.tag }}
114+
featured: ${{ github.event.inputs.status == 'stable' }}
115+
version_type: ${{ github.event.inputs.status == 'stable' && 'release' || 'beta' }}
116+
files: release-artifacts/*.jar

0 commit comments

Comments
 (0)