-
Notifications
You must be signed in to change notification settings - Fork 20
56 lines (46 loc) · 1.72 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
name: Gradle build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Gradle stuff
uses: actions/cache@v3
with:
key: gradle-${{ hashFiles('build.gradle', 'settings.gradle', 'gradle.properties', 'gradle/**') }}
restore-keys: |
gradle-${{ hashFiles('build.gradle', 'settings.gradle', 'gradle.properties', 'gradle/**') }}
gradle-
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle/quilt-loom-cache
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Build with Gradle
run: ./gradlew build
- name: Capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifact
path: build/libs/
# The following is based off of https://github.com/Cannoneers-of-Create/CreateBigCannons/blob/1.18.2/dev/.github/workflows/gradle.yml
- name: Get branch name
id: get_branch
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Send building message to discord
if: github.event_name == 'push' && github.repository_id == '344617531'
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Built mod from branch ${{ steps.get_branch.outputs.branch }}
- name: Send built file to discord
if: github.event_name == 'push' && github.repository_id == '344617531'
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/portal_cubed-*-rev.???????.jar