-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 2.2 KB
/
maven-publish.yml
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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Check 1.15.2 NMS existence
id: check_nms
uses: andstor/file-existence-action@v3
with:
files: "/home/runner/.m2/repository/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom"
- name: Download BuildTools
if: steps.check_nms.outputs.files_exists == 'false'
run: mkdir -p ./build/ && curl -L -o ./build/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
- name: Run BuildTools
if: steps.check_nms.outputs.files_exists == 'false'
run: cd build && java -jar BuildTools.jar --rev 1.15.2
- name: Check CrackShot existence
id: check_crackshot
uses: andstor/file-existence-action@v3
with:
files: "/home/runner/.m2/repository/com/shampaggon/CrackShot/0.98.11/CrackShot-0.98.11.pom"
- name: Download CrackShot v0.98.11
if: steps.check_crackshot.outputs.files_exists == 'false'
run: curl -L -o CrackShot.jar https://dev.bukkit.org/projects/crackshot/files/3151915/download
- name: Install CrackShot into local mvn repo
if: steps.check_crackshot.outputs.files_exists == 'false'
run: mvn install:install-file -Dfile=./CrackShot.jar -DgroupId=com.shampaggon -DartifactId=CrackShot -Dversion=0.98.11 -Dpackaging=jar -DgeneratePom=true
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload a Build Artifact
uses: actions/[email protected]