-
-
Notifications
You must be signed in to change notification settings - Fork 170
117 lines (102 loc) · 4.48 KB
/
build.yml
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
117
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get Release Info
id: release-info
uses: GeyserMC/actions/previous-release@master
with:
data: ${{ vars.RELEASEACTION_PREVRELEASE }}
- name: Checkout repository and submodules
# See https://github.com/actions/checkout/commits
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- name: Validate Gradle Wrapper
# See https://github.com/gradle/wrapper-validation-action/commits
uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
- name: Setup Java
# See https://github.com/actions/setup-java/commits
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 17
distribution: temurin
- name: Setup Gradle
# See https://github.com/gradle/actions/commits
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
cache-read-only: ${{ github.ref_name != 'master' && github.ref_name != 'development' }}
- name: Build Floodgate
run: ./gradlew build
env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
- name: Archive artifacts (Floodgate Bungee)
# See https://github.com/actions/upload-artifact/commits
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success()
with:
name: Floodgate Bungee
path: bungee/build/libs/floodgate-bungee.jar
if-no-files-found: error
- name: Archive artifacts (Floodgate Spigot)
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success()
with:
name: Floodgate Spigot
path: spigot/build/libs/floodgate-spigot.jar
if-no-files-found: error
- name: Archive artifacts (Floodgate Velocity)
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success()
with:
name: Floodgate Velocity
path: velocity/build/libs/floodgate-velocity.jar
if-no-files-found: error
- name: Publish to Maven Repository
if: ${{ github.repository == 'GeyserMC/Floodgate' }}
run: ./gradlew publish
env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
- name: Get Version
if: ${{ success() && github.repository == 'GeyserMC/Floodgate' && github.ref_name == 'master' }}
id: get-version
run: |
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
echo "VERSION=${version}" >> $GITHUB_OUTPUT
- name: Get Release Metadata
if: ${{ success() && github.repository == 'GeyserMC/Floodgate' && github.ref_name == 'master' }}
uses: GeyserMC/actions/release@master
id: metadata
with:
appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
files: |
bungee:bungee/build/libs/floodgate-bungee.jar
spigot:spigot/build/libs/floodgate-spigot.jar
velocity:velocity/build/libs/floodgate-velocity.jar
releaseEnabled: false
saveMetadata: true
releaseProject: 'floodgate'
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
- name: Publish to Downloads API
if: ${{ success() && github.ref_name == 'master' && github.repository == 'GeyserMC/Floodgate' }}
uses: GeyserMC/actions/upload-release@master
with:
username: ${{ vars.DOWNLOADS_USERNAME }}
privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
host: ${{ secrets.DOWNLOADS_SERVER_IP }}
files: |
bungee/build/libs/floodgate-bungee.jar
spigot/build/libs/floodgate-spigot.jar
velocity/build/libs/floodgate-velocity.jar
- name: Notify Discord
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Floodgate' }}
uses: GeyserMC/actions/notify-discord@master
with:
discordWebhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
body: ${{ steps.metadata.outputs.body }}