-
-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.61 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
name: Build
on: [push]
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.caching=true -Dorg.gradle.welcome=never"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Gradle
uses: GeyserMC/actions/setup-gradle-composite@master
with:
setup-java_java-version: 17
- name: Build Base API
run: ./gradlew build
- name: Publish to Maven Repository
if: ${{ success() && github.repository == 'GeyserMC/api' }}
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
- name: Get Version
if: ${{ github.repository == 'GeyserMC/api' }}
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: ${{ github.repository == 'GeyserMC/api' }}
uses: GeyserMC/actions/release@master
id: metadata
with:
appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
releaseEnabled: false
releaseProject: 'base-api'
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
- name: Notify Discords
if: ${{ github.repository == 'GeyserMC/api' }}
uses: GeyserMC/actions/notify-discord@master
with:
discordWebhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
body: ${{ steps.metadata.outputs.body }}