Back to snapshots #532
Workflow file for this run
This file contains 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 with Gradle | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [ 17 ] | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java-version }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: actions/cache@v3 | |
with: | |
path: '**/.gradle' | |
key: ${{ runner.os }}-gradle-${{ vars.CACHE_VERSION }}-${{ hashFiles('**/VersionConstants.kt', '**/build.gradle.kts', '**/gradle-wrapper.properties') }} | |
- name: Build | |
id: build | |
run: | | |
./gradlew clean build --stacktrace | |
echo "is-release=$(./gradlew -q printIsRelease)" >> "$GITHUB_OUTPUT" | |
echo "version=$(./gradlew -q printVersion)" >> "$GITHUB_OUTPUT" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Insights | |
path: jars/*.jar | |
- name: Publish to Maven Repository | |
if: ${{ github.event_name == 'push' }} | |
env: | |
FVDH_USERNAME: ${{ secrets.FVDH_USERNAME }} | |
FVDH_TOKEN: ${{ secrets.FVDH_TOKEN }} | |
run: ./gradlew publish --stacktrace | |
- uses: Kir-Antipov/[email protected] | |
if: ${{ github.event_name == 'push' && steps.build.outputs.is-release == 'true' }} | |
with: | |
name: ${{ format('Insights {0}', steps.build.outputs.version) }} | |
version: ${{ steps.build.outputs.version }} | |
modrinth-id: V27CDDh1 | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
changelog-file: CHANGELOG.md | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
jars/*.jar | |
loaders: | | |
paper | |
purpur | |
game-versions: | | |
>=1.19 <=1.20.4 | |
game-version-filter: releases | |
java: 17 |