ChestsPlusPlus/.github/workflows/maven.yml

97 lines
2.6 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 ]
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
key: buildtools-cache-${{ hashFiles('spigot-*.jar') }}
restore-keys: buildtools-cache-
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 21:07:00 +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 21:07:00 +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 21:07:00 +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 21:07:00 +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-13 00:34:45 +01:00
- name: Build with Maven
run: mvn -B package --file pom.xml
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
if: startsWith(github.event.ref, 'refs/tags/v')
with:
draft: true
generate_release_notes: true
files: |
${GITHUB_WORKSPACE}/Server/plugins/ChestsPlusPlus-*.jar
2022-01-12 23:43:36 +01:00