ci: Updating build pipeline

This commit is contained in:
Sekwah 2021-05-22 00:36:03 +01:00
parent 4b047466f6
commit 4fa4a1f8bf
No known key found for this signature in database
GPG Key ID: C3BE2E6C861A461A
3 changed files with 41 additions and 4 deletions

40
.github/workflows/gradle.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Build Project
on:
push:
branches:
- '**'
tags:
- '*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '1.8'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle
run: ./gradlew build
- name: Upload to Discord (If pre-release tag)
if: "startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')"
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: ./gradlew discordupload
- name: Publish to Curseforge (If release tag)
if: "startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')"
env:
CURSE_API: ${{ secrets.CURSE_API }}
run: ./gradlew curseforge

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
*.class
.*
!.github
/build/
/target/

View File

@ -1,4 +0,0 @@
language: java
cache:
directories:
- $HOME/.m2