-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (98 loc) · 3.2 KB
/
Copy pathrelease.yml
File metadata and controls
116 lines (98 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Release
on:
workflow_dispatch:
inputs:
tag:
required: true
description: "Tag"
status:
required: true
description: "Status (beta, stable)"
publish_modrinth:
required: true
description: "Publish to Modrinth"
default: "true"
env:
VERSION: ${{ github.event.inputs.tag }}-${{ github.event.inputs.status }}
concurrency:
group: release-${{ github.event.inputs.tag }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make gradlew executable
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build -PVERSION="${{ env.VERSION }}" --no-daemon
- name: Collect release artifacts
run: |
mkdir -p release-artifacts
find modules -path "*/build/libs/*.jar" \
! -name "*-sources.jar" \
! -name "*-thin.jar" \
! -path "*/core/build/libs/*" \
-exec cp {} release-artifacts/ \;
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: geyservoice-release
path: release-artifacts/*.jar
if-no-files-found: error
publish_release:
name: Publish release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: geyservoice-release
path: release-artifacts
- name: Create release
if: github.event.inputs.status == 'stable'
uses: ncipollo/release-action@v1.14.0
with:
prerelease: false
tag: ${{ github.event.inputs.tag }}
artifacts: release-artifacts/*.jar
artifactErrorsFailBuild: true
allowUpdates: true
replacesArtifacts: true
- name: Create pre-release
if: github.event.inputs.status != 'stable'
uses: ncipollo/release-action@v1.14.0
with:
prerelease: true
tag: ${{ github.event.inputs.tag }}
artifacts: release-artifacts/*.jar
artifactErrorsFailBuild: true
allowUpdates: true
replacesArtifacts: true
- name: Create Modrinth release
if: github.event.inputs.publish_modrinth == 'true'
uses: dsx137/modrinth-release-action@main
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
with:
name: GeyserVoice ${{ github.event.inputs.tag }}
project_id: WtPu56Wa
loaders: paper, purpur, velocity, bungeecord
game_versions: 1.21.11:26.1
version_number: ${{ github.event.inputs.tag }}
featured: ${{ github.event.inputs.status == 'stable' }}
version_type: ${{ github.event.inputs.status == 'stable' && 'release' || 'beta' }}
files: release-artifacts/*.jar