-
Notifications
You must be signed in to change notification settings - Fork 34
56 lines (56 loc) · 2.07 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
51
52
53
54
55
56
name: Build
on: [ push, pull_request ]
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
fail-fast: true
steps:
- name: Checkout Git Repository
uses: actions/checkout@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Pull Gradle Cache
uses: actions/cache@v2
id: gradle-cache
with:
path: ~/.gradle
key: ${{ runner.os }}-maven-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-java-${{ matrix.java }}
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- name: Patch
run: |
./gradlew applyPatches --stacktrace --no-daemon
- name: Get MC Version
run: echo "::set-output name=mcver::$(grep mcVersion gradle.properties | awk '{print $3;}')"
id: mcver
- name: Build
run: |
./gradlew createReobfPaperclipJar --stacktrace --no-daemon
- name: Archive Paperclip
uses: actions/upload-artifact@v2
with:
name: Patina
path: build/libs/patina-paperclip-${{ steps.mcver.outputs.mcver }}-R0.1-SNAPSHOT-reobf.jar
- name: Prepare Github Page Files
run: |
mkdir -p public
cp build/libs/patina-paperclip-${{ steps.mcver.outputs.mcver }}-R0.1-SNAPSHOT-reobf.jar public/
- name: Deploy to Github Pages
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: releases/${{ steps.mcver.outputs.mcver }}