-
Notifications
You must be signed in to change notification settings - Fork 810
37 lines (34 loc) · 1.1 KB
/
gradle.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
name: gradle-ci
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache/Uncache Sodium
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build artifacts
run: ./gradlew build
- name: Extract current branch name
shell: bash
# bash pattern expansion to grab branch name without slashes
run: ref="${GITHUB_REF#refs/heads/}" && echo "::set-output name=branch::${ref////-}"
id: ref
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: sodium-artifacts-${{ steps.ref.outputs.branch }}
# Filter built files to disregard -sources and -dev, and leave only the minecraft-compatible jars.
path: build/libs/*[0-9].jar