-
Notifications
You must be signed in to change notification settings - Fork 44
80 lines (69 loc) · 2.76 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
name: Build
on:
workflow_dispatch:
push:
paths-ignore:
- '.idea/copyright/*.xml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
- 'bind9/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
# See https://github.com/actions/checkout/commits
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- 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:
gradle-home-cache-cleanup: true
- name: Build GeyserConnect
run: ./gradlew build
- name: Archive artifacts
# See https://github.com/actions/upload-artifact/commits
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success()
with:
name: GeyserConnect
path: build/libs/GeyserConnect.jar
if-no-files-found: error
- name: Get Version
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
id: get-version
run: |
version=$(cat build.gradle | grep -o "version '[0-9\\.]*'" | cut -d" " -f2 | sed "s/'//g")
echo "VERSION=${version}" >> $GITHUB_OUTPUT
- name: Get Release Metadata
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
uses: GeyserMC/actions/release@master
id: metadata
with:
appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
files: |
geyserconnect:build/libs/GeyserConnect.jar
releaseEnabled: false
saveMetadata: true
releaseProject: 'geyserconnect'
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
- name: Publish to Downloads API
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
uses: GeyserMC/actions/upload-release@master
with:
username: ${{ vars.DOWNLOADS_USERNAME }}
privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
host: ${{ secrets.DOWNLOADS_SERVER_IP }}
files: |
build/libs/GeyserConnect.jar