Merge remote-tracking branch 'origin/master' #76
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Build | |
on: | |
push: | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: | | |
./gradlew apiJar | |
./gradlew remapApiJar | |
./gradlew build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was NOT triggered by the default branch | |
with: | |
name: build | |
path: build/libs/* | |
- name: Remove *-dev.jar | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch | |
run: rm ./build/libs/*-dev.jar || true | |
- name: Remove *-api.jar | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch | |
run: rm ./build/libs/*-api.jar || true | |
- name: Create prerelease | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "prerelease" | |
prerelease: true | |
title: "Prerelease Build" | |
files: | | |
./build/libs/*.jar | |