Skip to content

Fixed #325

Fixed #325 #1651

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build And Publish to Modrinth
on : [push, pull_request]
env:
MINECRAFT_VERSION: 1.20.1
VERSION: 1.20.x-snapshot
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
RELEASE_NAME: banner-1.20.x
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Set version env
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Publish to ModRinth
uses: Kir-Antipov/mc-publish@v3.3.0
with:
modrinth-id: 7ntInrAy
modrinth-token: "${{env.MODRINTH_TOKEN}}"
name: "${{env.RELEASE_NAME}}"
version: "${{env.VERSION}}"
version-type: release
loaders: fabric
game-versions: '1.20.1'
java: "17"