Slimefun Build Test #1328
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 Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Slimefun Build Test | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'src/**' | |
- 'pom.xml' | |
pull_request: | |
paths: | |
- '.github/workflows/**' | |
- 'src/**' | |
- 'pom.xml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
java-package: jdk | |
architecture: x64 | |
- run: mvn -B test --file pom.xml --errors | |
- uses: actions/cache@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- uses: actions/upload-artifact@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
name: Slimefun.jar | |
path: staging | |
- name: Automatic Releases | |
uses: marvinpinto/[email protected] | |
if: github.event_name != 'pull_request' && github.ref_name == 'master' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "exp" | |
prerelease: true | |
title: "Slimefun 自动构建版本" | |
files: | | |
target/Slimefun-*.jar |