Finished README and completed CI #4
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: Java CI | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: | |
| - created | |
| permissions: | |
| contents: write | |
| jobs: | |
| buildJar: | |
| name: Build and Publish Jar | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build mod artifact | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew clean | |
| ./gradlew lib | |
| ./gradlew dex | |
| - name: Upload built mod artifact as a GitHub Action artifact | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'push' || github.event_name == 'pull_request' | |
| with: | |
| name: CustomJsonLib (zipped) | |
| path: | | |
| build/libs/CustomJsonLibCrossPlatform.jar | |
| build/libs/CustomJsonLib.jar | |
| if-no-files-found: error | |
| compression-level: 0 | |
| - name: Upload built mod artifact into release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.event_name == 'release' && github.event.action == 'created' | |
| with: | |
| files: ${{ endsWith(github.event.release.name, 'Library') && 'build/libs/CustomJsonLib.jar' || 'build/libs/CustomJsonLibCrossPlatform.jar' }} |