diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c52ac2..29f6a40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/cache@v3.0.4 - 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 "no-reply@github.com" 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/upload-artifact@v3.1.0 + ./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/action-automatic-releases@v1.2.1 -# 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 \ No newline at end of file