Gradle build #885
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |