ci: fix scan-deps by using java 17 #3
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
| # GravenSupport CI/CD | |
| # Maintained by AntoineJT | |
| name: GravenSupport CI/CD | |
| on: | |
| push: | |
| branches: "**" | |
| tags-ignore: latest | |
| pull_request: | |
| branches: "**" | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Set up Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Setup Gradle permission | |
| run: chmod +x gradlew | |
| - name: Check code formatting | |
| run: ./gradlew spotlessCheck | |
| - name: Execute Gradle build | |
| run: ./gradlew build | |
| - name: Cache everything for CD | |
| if: github.ref_type == 'tag' | |
| uses: actions/cache@v3 | |
| with: | |
| path: . | |
| key: ci-data | |
| cd: | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| if: github.ref_type == 'tag' | |
| steps: | |
| - name: Restore data from cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: . | |
| key: ci-data | |
| - name: Prepare files for release | |
| run: | | |
| mkdir gh_release | |
| cp LICENSE.md build/resources/main/config.default.yml build/libs/*-all.jar gh_release | |
| - name: Create release zip file | |
| uses: TheDoctor0/zip-release@0.6.2 | |
| with: | |
| filename: "GravenSupport-${{ github.sha }}.zip" | |
| directory: ./gh_release | |
| - name: Publish release '${{ github.ref_name }}' | |
| uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| automatic_release_tag: "latest" | |
| prerelease: false | |
| title: "GravenSupport '${{ github.ref_name }}'" | |
| files: "./gh_release/GravenSupport-${{ github.sha }}.zip" |