2021-04-05 15:47:34 +02:00
|
|
|
name: Build Project
|
2021-03-23 02:49:20 +01:00
|
|
|
|
2021-04-05 15:47:34 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-05-12 02:19:01 +02:00
|
|
|
- '**'
|
2021-04-05 15:47:34 +02:00
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
2021-03-23 02:49:20 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-05-09 04:45:31 +02:00
|
|
|
- uses: actions/checkout@v2
|
2021-04-05 15:47:34 +02:00
|
|
|
- name: Set up JDK 1.8
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.8
|
2021-05-09 04:45:31 +02:00
|
|
|
- name: Cache Gradle packages
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
2021-04-05 15:47:34 +02:00
|
|
|
- name: Build with Gradle
|
|
|
|
run: ./gradlew build
|
2021-05-12 03:07:31 +02:00
|
|
|
- name: Upload to Discord (If pre-release tag)
|
|
|
|
if: "startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')"
|
2021-04-05 15:47:34 +02:00
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
run: ./gradlew discordupload
|
2021-05-12 03:07:31 +02:00
|
|
|
- name: Publish to Curseforge (If release tag)
|
|
|
|
if: "startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')"
|
2021-04-05 15:47:34 +02:00
|
|
|
env:
|
|
|
|
CURSE_API: ${{ secrets.CURSE_API }}
|
|
|
|
run: ./gradlew curseforge
|