diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..94dfe4e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: daily + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d02ebe8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: Build Project + +on: + push: + branches: [ master, ver/* ] + pull_request: + branches: [ master, ver/* ] + + workflow_dispatch: + +jobs: + + setup: + runs-on: ubuntu-latest + name: Maven Setup + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + - name: Setup Project + run: mvn clean install dependency:tree -DskipTests + + build: + needs: setup + strategy: + matrix: + java-version: [8, 11, 16, 17, 18, 19] + + runs-on: ubuntu-latest + name: Build Java ${{ matrix.java-version }} + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + cache: 'maven' + - name: Build Project + run: mvn clean package -Dmaven.javadoc.skip=true + + deploy: + runs-on: ubuntu-latest + needs: build + name: Deploy JavaDocs + if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }} + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + + - name: Build Project + run: mvn package -DskipTests + + - name: Build JavaDocs + run: bash javadoc.sh ${GITHUB_SHA::7} \ No newline at end of file diff --git a/javadoc.sh b/javadoc.sh new file mode 100644 index 0000000..4adce06 --- /dev/null +++ b/javadoc.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +git config --local user.email "action@github.com" +git config --local user.name "GitHub Actions" +git fetch origin gh-pages + +rm -rf docs/ +mkdir ./docs + +cp -R target/apidocs/* docs/ + +git switch -f gh-pages + +for dir in ./* +do + if [ "$dir" == "./docs" ]; then + continue + fi + + rm -rf "$dir" +done + +cp -Rfv ./docs/* ./ +rm -rf ./docs + +echo "vortexsidebars.teaminceptus.us" > CNAME + +git add . +git commit -m "Update JavaDocs ($1)" +git push -f origin gh-pages \ No newline at end of file