TamableFoxes/.github/workflows/maven.yml

89 lines
3.1 KiB
YAML
Raw Normal View History

2021-07-08 22:05:01 +00:00
# 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: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2021-07-09 00:02:02 +00:00
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Build tools directory
uses: actions/cache@v2
with:
path: ~/buildtools
key: ${{ runner.os }}-spigot-${{ hashFiles('compileSpigotVersions.sh') }}
restore-keys: ${{ runner.os }}-spigot
- name: maven-settings-action
uses: s4u/maven-settings-action@v2.5.0
with:
servers: |
[{
"id": "seanomik-maven-spigot-private",
"username": "${{ secrets.MAVEN_SPIGOT_REPO_USER }}",
"password": "${{ secrets.MAVEN_SPIGOT_REPO_SECRET }}"
}]
- name: Install OpenJDK 8
uses: actions/setup-java@v2
2021-07-08 22:05:01 +00:00
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'
#- name: Download buildtools
# run: |
# mkdir ~/buildtools
# cd ~/buildtools
# wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
#- name: Compile 1.14.4, 1.15, 1.16.1, 1.16.3, 1.16.5 Spigot
# run: |
# cd ~/buildtools
# java -jar ./BuildTools.jar --rev 1.14.4
# java -jar ./BuildTools.jar --rev 1.15
# java -jar ./BuildTools.jar --rev 1.16.1
# java -jar ./BuildTools.jar --rev 1.16.3
# java -jar ./BuildTools.jar --rev 1.16.5
#- name: Install OpenJDK 16
# uses: actions/setup-java@v2
2021-07-08 23:48:09 +00:00
# with:
# distribution: 'temurin' # See 'Supported distributions' for available options
# java-version: '16'
#- name: Compile 1.17, 1.17.1 Moajng Remapped Spigot
# run: |
# cd ~/buildtools
# java -jar ./BuildTools.jar --rev 1.17 --remapped remapped-mojang
# java -jar ./BuildTools.jar --rev 1.17.1 --remapped remapped-mojang
- name: Install OpenJDK 17
uses: actions/setup-java@v2
2021-07-08 23:48:09 +00:00
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
#- name: Compile 1.18, 1.18.1 Moajng Remapped Spigot
# run: |
# cd ~/buildtools
# java -jar ./BuildTools.jar --rev 1.18 --remapped remapped-mojang
# java -jar ./BuildTools.jar --rev 1.18.1 --remapped remapped-mojang
2021-07-10 04:57:50 +00:00
- name: Debug - java version
run: |
java -version
#- name: Install with Maven
# env:
# JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/16.0.1-9/x64
# run: |
# sudo mvn install
2021-07-08 22:05:01 +00:00
- name: Build with Maven
env:
JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/16.0.1-9/x64
2021-07-08 23:48:09 +00:00
run: |
sudo mvn -f ./ci-pom.xml package