ci: Automatically publish apis to maven & add hangar deployment config #782
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and test | |
| on: | |
| push: | |
| pull_request: | |
| types: | |
| - opened | |
| jobs: | |
| build-plugins: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '21' | |
| - name: Modify gradlew permissions | |
| run: chmod +x ./gradlew | |
| - name: Build FancyNpcs v2 | |
| run: ./gradlew :plugins:fancynpcs-v2:shadowJar | |
| - name: Build FancyNpcs | |
| run: ./gradlew :plugins:fancynpcs:shadowJar | |
| - name: Build FancyHolograms v2 | |
| run: ./gradlew :plugins:fancyholograms-v2:shadowJar | |
| - name: Build FancyHolograms | |
| run: ./gradlew :plugins:fancyholograms:shadowJar | |
| - name: Build FancyDialogs | |
| run: ./gradlew :plugins:fancydialogs:shadowJar | |
| - name: Build FancyVisuals | |
| run: ./gradlew :plugins:fancyvisuals:shadowJar | |
| build-libraries: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '21' | |
| - name: Modify gradlew permissions | |
| run: chmod +x ./gradlew | |
| - name: Build common | |
| run: ./gradlew :libraries:common:jar | |
| - name: Build jdb | |
| run: ./gradlew :libraries:jdb:jar | |
| - name: Build plugin-tests | |
| run: ./gradlew :libraries:plugin-tests:jar | |
| - name: Build packets | |
| run: ./gradlew :libraries:packets:shadowJar | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '21' | |
| - name: Modify gradlew permissions | |
| run: chmod +x ./gradlew | |
| - name: Run unit tests | |
| run: ./gradlew test |