Adjust to Architectury, apply targeting to neoforge. Change build YAML #27
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
on: | |
workflow_dispatch: | |
inputs: | |
mc_version: | |
description: 'Minecraft Version' | |
required: true | |
type: 'string' | |
default: '1.21.1' | |
mod_version: | |
description: 'Mod Version' | |
required: true | |
type: 'string' | |
default: '0.5.0' | |
version_type: | |
description: 'Version Type' | |
required: true | |
type: 'choice' | |
options: | |
- 'alpha' | |
- 'beta' | |
- 'release' | |
default: 'release' | |
env: | |
JAVA_VERSION: 21 | |
VERSION_TITLE: "${{inputs.mc_version}}+${{inputs.mod_version}}-${{inputs.version_type}}" | |
permissions: | |
contents: write | |
jobs: | |
gradle: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
steps: | |
- name: Check Environment Variables | |
run: env | |
- name: Checkout Code | |
- uses: actions/checkout@v4 | |
- name: Setup Java | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/loom-cache | |
~/.gradle/wrapper | |
key: gradle-${{ hashFiles('**/gradle-wrapper.properties') }}-${{ hashFiles('./gradle.properties') }}-${{ hashFiles('./libs.versions.toml') }} | |
restore-keys: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Build | |
run: ./gradlew clean neoforge:build fabric:build | |
- name: Capture Fabric Build Artifacts | |
uses: actions/upload-artifact@v4.4.0 | |
with: | |
name: Fabric Artifacts | |
path: fabric/build/libs/ | |
- name: Capture NeoForge Build Artifacts | |
uses: actions/upload-artifact@v4.4.0 | |
with: | |
name: NeoForge Artifacts | |
path: neoforge/build/libs/ | |
- name: 'MC Publish NeoForge Assets' | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
name: "NeoForge ${{ENV.VERSION_TITLE}}" | |
modrinth-id: iB0MlSms | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: false | |
curseforge-id: 915450 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
neoforge/build/libs/!(*-@(dev|sources|all|javadoc|shadow)).jar | |
neoforge/build/libs/*-@(dev|sources|javadoc).jar | |
loaders: neoforge | |
version-type: ${{ inputs.version_type }} | |
version: "neoforge-${{inputs.mod_version}}" | |
game-versions: | | |
>=1.21.1 | |
- name: 'MC Publish Fabric Assets' | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
name: "Fabric ${{ENV.VERSION_TITLE}}" | |
modrinth-id: iB0MlSms | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: false | |
curseforge-id: 915450 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
fabric/build/libs/!(*-@(dev|sources|all|javadoc|shadow)).jar | |
fabric/build/libs/*-@(dev|sources|javadoc).jar | |
loaders: fabric | |
version-type: ${{ inputs.version_type }} | |
version: "fabric-${{inputs.mod_version}}" | |
game-versions: | | |
>=1.21.1 | |
- name: 'MC Publish Github Release' | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
name: "Complete ${{ENV.VERSION_TITLE}}" | |
github-generate-changelog: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
fabric/build/libs/!(*-@(dev|sources|all|javadoc|shadow)).jar | |
neoforge/build/libs/!(*-@(dev|sources|all|javadoc)).jar |