This repository was archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (64 loc) · 1.88 KB
/
java.yml
File metadata and controls
67 lines (64 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Java Build
on:
push:
branches:
- trunk
tags:
- v*
pull_request:
env:
JDK_VERSION: '17'
SPIGOT_VERSION: '1.18.1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: ${{ env.JDK_VERSION }}
cache: maven
- name: Compile Spigot with BuildTools
uses: SpraxDev/Action-SpigotMC@v3
with:
versions: ${{ env.SPIGOT_VERSION }}
buildToolProvider: SpigotMC
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Resolve .jar name
id: prep
run: |
JAR_PATH=`echo target/Mammoth*.jar`
JAR_NAME=`basename ${JAR_PATH}`
echo ::set-output name=jar_path::${JAR_PATH}
echo ::set-output name=jar_name::${JAR_NAME}
- name: Upload .jar
if: contains(github.ref, 'refs/tags/') == false
uses: actions/upload-artifact@v2
with:
name: ${{ steps.prep.outputs.jar_name }}
path: ${{ steps.prep.outputs.jar_path }}
- name: Create Release
if: contains(github.ref, 'refs/tags/') == true
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Mammoth ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
if: contains(github.ref, 'refs/tags/') == true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.prep.outputs.jar_path }}
asset_name: ${{ steps.prep.outputs.jar_name }}
asset_content_type: application/java-archive