Publish #21
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 CD | |
on: | |
workflow_dispatch: | |
jobs: | |
build_and_publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get mod version from Gradle | |
uses: madhead/read-java-properties@latest | |
id: mod_version | |
with: | |
file: gradle.properties | |
property: mod_version | |
default: 0.0.1 | |
- name: Get supported Minecraft version from Gradle | |
uses: madhead/read-java-properties@latest | |
id: supported_minecraft_version | |
with: | |
file: gradle.properties | |
property: supported_minecraft_version_name | |
default: 0.0.1 | |
- run: echo version string ${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version.outputs.value }} | |
- name: Setup JDK (Temurin 17) | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Change Gradle wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Execute Gradle build | |
run: ./gradlew build | |
# https://github.com/marketplace/actions/publish-minecraft-mods | |
- name: Publish mod | |
uses: Kir-Antipov/[email protected] | |
with: | |
# GitHub releases | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Modrinth | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
# CurseForge | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
name: ${{ steps.mod_version.outputs.value }} (${{ steps.supported_minecraft_version.outputs.value }}) | |
github-tag: v${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version.outputs.value }} | |
files-primary: build/libs/!(*-@(dev|sources|javadoc)).jar | |
files-secondary: build/libs/*-@(dev|sources|javadoc).jar | |
version-type: release | |
modrinth-featured: false | |
changelog-file: CHANGELOG_LATEST.md |