-
-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (48 loc) · 1.51 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
name: Java CI
on:
push:
branches: [ main, dev ]
workflow_dispatch:
inputs:
norelease:
description: 'Do not publish'
required: true
default: 'false'
jobs:
build:
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[ciskip]')
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v2
with:
fetch-depth: 30 # Gets the last 30 commits so the changelog might work
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Build with Gradle
env:
SAPS_TOKEN: ${{ secrets.SAPS_TOKEN }}
run: |
chmod +x ./gradlew
./gradlew build publish --stacktrace --no-daemon
- name: Release to CurseForge
if: |
github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[norelease]') && github.event.inputs.norelease != 'true'
env:
GIT_COMMIT: ${{ github.event.after }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }}
run: |
chmod +x ./gradlew
./gradlew build curseforge --stacktrace --no-daemon