ChestsPlusPlus/.github/workflows/maven.yml

110 lines
2.7 KiB
YAML
Raw Normal View History

2022-01-12 21:33:01 +01:00
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build ChestsPlusPlus
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
2022-01-17 22:41:13 +01:00
create:
tags:
- v*
2022-01-12 21:33:01 +01:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2022-01-12 23:12:05 +01:00
- name: Cache BuildTools
id: cache-buildtools
uses: actions/cache@v2
with:
path: |
~/.m2
2022-01-17 20:56:40 +01:00
~/BuildTools
2022-01-17 22:20:48 +01:00
key: buildtools-cache-${{ hashFiles('**/spigot-*.jar') }}
2022-01-12 23:12:05 +01:00
2022-01-13 00:06:12 +01:00
- name: Check BuildTools cached
run: |
2022-01-13 00:26:57 +01:00
mkdir -p ~/BuildTools
ls ~/BuildTools
2022-01-13 00:06:12 +01:00
shell: bash
2022-01-17 22:25:47 +01:00
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
2022-01-12 23:12:05 +01:00
2022-01-17 22:25:47 +01:00
- name: Run BuildTools Pre 1.17
working-directory: BuildTools
run: |
cd ~/BuildTools
# make file runnable, might not be necessary
chmod +x "${GITHUB_WORKSPACE}/BuildTools/build-pre1.17.sh"
# run script
bash ${GITHUB_WORKSPACE}/BuildTools/build-pre1.17.sh
shell: bash
2022-01-12 21:33:01 +01:00
2022-01-17 22:25:47 +01:00
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
2022-01-12 23:12:05 +01:00
2022-01-17 22:25:47 +01:00
- name: Run BuildTools 1.17
working-directory: BuildTools
run: |
cd ~/BuildTools
# make file runnable, might not be necessary
chmod +x "${GITHUB_WORKSPACE}/BuildTools/build-1.17.sh"
# run script
bash ${GITHUB_WORKSPACE}/BuildTools/build-1.17.sh
shell: bash
2022-01-12 21:33:01 +01:00
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
2022-01-12 23:12:05 +01:00
2022-01-12 21:33:01 +01:00
- name: Run BuildTools 1.18+
2022-01-13 00:26:57 +01:00
working-directory: BuildTools
2022-01-12 21:43:58 +01:00
run: |
2022-01-13 00:26:57 +01:00
cd ~/BuildTools
2022-01-12 23:58:19 +01:00
# make file runnable, might not be necessary
2022-01-12 21:43:58 +01:00
chmod +x "${GITHUB_WORKSPACE}/BuildTools/build-1.18+.sh"
# run script
2022-01-13 00:17:48 +01:00
bash ${GITHUB_WORKSPACE}/BuildTools/build-1.18+.sh
2022-01-13 00:34:45 +01:00
shell: bash
2022-01-12 21:33:01 +01:00
2022-01-17 22:20:48 +01:00
- name: Check BuildTools cached
run: |
mkdir -p ~/BuildTools
ls ~/BuildTools
shell: bash
2022-01-17 22:25:47 +01:00
- name: Build with Maven
run: mvn -B package --file pom.xml
2022-01-17 23:04:36 +01:00
2022-01-17 23:08:54 +01:00
# - name: Check Folders
# run: |
# ls -R
# shell: bash
2022-01-12 23:43:36 +01:00
2022-01-13 00:34:45 +01:00
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
2022-01-17 22:35:42 +01:00
if: startsWith(github.ref, 'refs/tags/v')
2022-01-13 00:34:45 +01:00
with:
draft: true
generate_release_notes: true
files: |
2022-01-17 23:08:54 +01:00
./Server/plugins/ChestsPlusPlus-*.jar
2022-01-12 23:43:36 +01:00