v1.5.0-1.20.4 #16
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
#file: noinspection SpellCheckingInspection | |
name: publish | |
run-name: ${{ github.ref_name }} | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
strategy: | |
matrix: | |
java: [ 17 ] | |
os: [ windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "Cache Gradle packages" | |
uses: actions/cache@v4 | |
id: cache-gradle | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}" | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: "Read gradle.properties and set variables (Windows)" | |
if: ${{ runner.os == 'Windows' }} | |
shell: pwsh | |
run: | | |
$properties = Get-Content -Path gradle.properties -Raw | ConvertFrom-StringData | |
foreach ($key in $properties.Keys) { | |
$value = $properties[$key] | |
if ($key.StartsWith('#') -or [string]::IsNullOrEmpty($key)) { | |
continue | |
} | |
if ($value.Contains('|')) { | |
$value = $value.Trim('[]').Replace(' ', '') | |
$array = $value.Split('|') | |
$value = $array -join "`n" | |
} | |
"$key<<EOF" >> $env:GITHUB_ENV | |
"$value" >> $env:GITHUB_ENV | |
"EOF" >> $env:GITHUB_ENV | |
} | |
- name: "Validate gradle wrapper" | |
uses: gradle/wrapper-validation-action@v3 | |
- name: "Setup jdk ${{ matrix.java }}" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- name: "Make gradle wrapper executable" | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: "Run gradle task: (fabric) -> datagen" | |
run: ./gradlew :fabric:runDatagen | |
- name: "Run gradle task: (forge) -> datagen" | |
run: ./gradlew :forge:runData | |
- name: "Run gradle task: (neoforge) -> datagen" | |
run: ./gradlew :neoforge:runData | |
- name: "Build project" | |
run: ./gradlew build | |
- name: "Capture build artifacts" | |
if: ${{ runner.os == 'Windows' && matrix.java == '17' }} # Only upload artifacts built from the latest java on one OS | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Artifacts | |
path: | | |
forge/build/libs/ | |
neoforge/build/libs/ | |
fabric/build/libs/ | |
- name: "Publish FORGE" | |
if: ${{ runner.os == 'Windows' }} | |
uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: ${{ env.modrinth_id }} | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: true | |
modrinth-unfeature-mode: intersection | |
curseforge-id: ${{ env.curseforge_id }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
forge/build/libs/!(*-@(dev|sources|javadoc)).jar | |
forge/build/libs/*-@(dev|sources|javadoc).jar | |
name: "v${{ env.version }} (${{ env.minecraft_version }}) FORGE" | |
version: "${{ env.version }}" | |
version-type: "${{ env.version_type }}" | |
changelog-file: changelog.md | |
loaders: | | |
forge | |
game-versions: ${{ env.minecraft_version_range }} | |
java: ${{ matrix.java }} | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: warn | |
- name: "Publish NEOFORGE" | |
if: ${{ runner.os == 'Windows' }} | |
uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: ${{ env.modrinth_id }} | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: true | |
modrinth-unfeature-mode: intersection | |
curseforge-id: ${{ env.curseforge_id }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
neoforge/build/libs/!(*-@(dev|sources|javadoc)).jar | |
neoforge/build/libs/*-@(dev|sources|javadoc).jar | |
name: "v${{ env.version }} (${{ env.minecraft_version }}) NEOFORGE" | |
version: "${{ env.version }}" | |
version-type: "${{ env.version_type }}" | |
changelog-file: changelog.md | |
loaders: | | |
neoforge | |
game-versions: ${{ env.minecraft_version_range }} | |
java: ${{ matrix.java }} | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: warn | |
- name: "Publish FABRIC" | |
if: ${{ runner.os == 'Windows' }} | |
uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: ${{ env.modrinth_id }} | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: true | |
modrinth-unfeature-mode: intersection | |
curseforge-id: ${{ env.curseforge_id }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
fabric/build/libs/!(*-@(dev|sources|javadoc)).jar | |
fabric/build/libs/*-@(dev|sources|javadoc).jar | |
name: "v${{ env.version }} (${{ env.minecraft_version }}) FABRIC" | |
version: "${{ env.version }}" | |
version-type: "${{ env.version_type }}" | |
changelog-file: changelog.md | |
loaders: | | |
fabric | |
game-versions: ${{ env.minecraft_version_range }} | |
java: ${{ matrix.java }} | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: warn |