-
-
Notifications
You must be signed in to change notification settings - Fork 20
68 lines (66 loc) · 2.16 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
name: build
on:
pull_request:
push:
paths-ignore:
- resources/**
branches-ignore:
- l10n
permissions:
id-token: write
contents: read
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: setup python for uploader
uses: actions/setup-python@v5
with:
python-version : '3.12'
cache: pip
- name: cache loom-cache
uses: actions/cache@v4
with:
path: .gradle/loom-cache
key: loom-cache-${{ hashFiles('gradle.properties') }}
- name: setup gradle
uses: gradle/actions/setup-gradle@v3
- name: build
id: gradle
run: ./gradlew --stacktrace --parallel clean build
- name: Get Id Token
if: github.ref == 'refs/heads/master'
uses: actions/github-script@v7
id: idtoken
with:
script: |
let id_token = await core.getIDToken("https://mc.pswg.dev")
core.setOutput('id_token', id_token)
- name: upload
if: always() && github.ref == 'refs/heads/master' && (steps.gradle.outcome == 'success' || steps.gradle.outcome == 'failure')
continue-on-error: true
run: |
pip install -r scripts/requirements.txt
mkdir -p projects/pswg/build/libs
cd projects/pswg/build/libs
python ../../../../scripts/upload_dev.py --token ${{ steps.idtoken.outputs.id_token }} --result ${{ steps.gradle.outcome }} --webhook ${{ secrets.DISCORD_DEV_FEED_WEBHOOK }} --webhook ${{ secrets.DISCORD_RCOE_WEBHOOK }} --serverupdate ${{ secrets.SERVER_UPDATER }}
env:
BUILD_NUMBER: ${{ github.run_number }}