58 lines
2.8 KiB
YAML
58 lines
2.8 KiB
YAML
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 (GraalVM)
|
|
uses: DeLaGuardo/setup-graalvm@master
|
|
with:
|
|
# GraalVM version, no pattern syntax available atm
|
|
graalvm: '21.3.0'
|
|
# Java version, optional, defaults to 'java8'. Available options are 'java8' and 'java11'.
|
|
java: 'java17'
|
|
# Architecture flag, optional, defaults to 'amd64'. Available options are 'amd64' and 'aarch64'. Later is available only for linux runners.
|
|
arch: 'amd64'
|
|
- 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 "no-reply@github.com"
|
|
git config --global user.name "Github Actions"
|
|
- name: Patch
|
|
run: |
|
|
./gradlew -Dorg.gradle.jvmargs="-Dfile.encoding=UTF-8 -Djdk.nio.maxCachedBufferSize=262144 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true --add-modules jdk.incubator.vector" applyPatches --stacktrace --no-daemon
|
|
- name: Build
|
|
run: |
|
|
./gradlew -Dorg.gradle.jvmargs="-Dfile.encoding=UTF-8 -Djdk.nio.maxCachedBufferSize=262144 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true --add-modules jdk.incubator.vector" createReobfPaperclipJar --stacktrace --no-daemon
|
|
- name: Archive Paperclip
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Mirai-1.18.1
|
|
path: build/libs/mirai-paperclip-1.18.1-R0.1-SNAPSHOT-reobf.jar
|
|
- name: Prepare Github Page Files
|
|
run: |
|
|
mkdir -p public
|
|
cp build/libs/mirai-paperclip-1.18.1-R0.1-SNAPSHOT-reobf.jar public/Mirai-1.18.1-R0.1-SNAPSHOT.jar
|
|
- 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: build/1.18
|