This repository has been archived by the owner on May 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80da0d3
commit 8f86ef5
Showing
1 changed file
with
41 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,55 @@ | ||
name: Build | ||
on: push | ||
name: Build Main | ||
on: [ push ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 17 ] | ||
fail-fast: true | ||
steps: | ||
- name: Checkout Git Repository | ||
uses: actions/checkout@v3.0.2 | ||
uses: actions/checkout@v2 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1.0.4 | ||
- name: Set up JDK (GraalVM) | ||
uses: graalvm/setup-graalvm@v1 | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
version: 'latest' | ||
java-version: '17' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Pull Gradle Cache | ||
uses: actions/[email protected] | ||
id: gradle-cache | ||
with: | ||
path: ~/.gradle | ||
key: ${{ runner.os }}-maven-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-java-${{ matrix.java }} | ||
java-version: ${{ matrix.java }} | ||
distribution: 'adopt' | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Actions" | ||
chmod +x gradlew | ||
- name: Patch | ||
- name: Patch Brilliant | ||
run: | | ||
./gradlew -Dorg.gradle.jvmargs="-Dfile.encoding=UTF-8 -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 | ||
./gradlew applyPatches --stacktrace --no-daemon | ||
- name: Build Brilliant | ||
run: | | ||
./gradlew -Dorg.gradle.jvmargs="-Dfile.encoding=UTF-8 -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/[email protected] | ||
./gradlew createReobfPaperclipJar --stacktrace --no-daemon | ||
- name: Set outputs | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ steps.vars.outputs.sha_short }} | ||
release_name: 'Brilliant ver/1.18 "${{ steps.vars.outputs.sha_short }}"' | ||
body: | | ||
This is a Auto-Release by GitHub Actions, | ||
**DO NOT** use it on production environment. | ||
draft: false | ||
prerelease: true | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: Mirai-1.19.2 | ||
path: build/libs/mirai-paperclip-1.19.2-R0.1-SNAPSHOT-reobf.jar | ||
# - name: Release | ||
# if: github.ref_name == 'ver/1.19' | ||
# uses: marvinpinto/[email protected] | ||
# with: | ||
# repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
# automatic_release_tag: '1.19' | ||
# prerelease: false | ||
# title: 'Mirai 1.19' | ||
# files: build/libs/mirai-paperclip-1.19-R0.1-SNAPSHOT-reobf.jar | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./build/libs/Brilliant-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar | ||
asset_name: brilliant.jar | ||
asset_content_type: application/java-archive |