-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changelog: see changelog.md
- Loading branch information
Showing
9 changed files
with
116 additions
and
109 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
#file: noinspection SpellCheckingInspection | ||
# Automatically build the project and run any configured tests for every push | ||
# and submitted pull request. This can help catch issues that only occur on | ||
# certain platforms or Java versions, and provides a first line of defence | ||
# against bad commits. | ||
|
||
run-name: "release: v1.4.3 - 1.20.2" | ||
|
||
name: publish | ||
on: workflow_dispatch | ||
|
||
env: | ||
VERSION: 1.4.3 | ||
MC_VERSION: "1.20.2" | ||
MC_VERSION_RANGE: | | ||
1.20 | ||
1.20.1 | ||
1.20.2 | ||
VERSION_TYPE: release | ||
CURSEFORGE_ID: 361354 | ||
MODRINTH_ID: "IQRVlbit" | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
|
@@ -29,13 +16,51 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Read gradle.properties and set variables (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
while IFS='=' read -r key value; do | ||
# Skip comments and empty lines | ||
if [[ $key == \#* ]] || [[ -z $key ]]; then | ||
continue | ||
fi | ||
# Check if the value contains a pipe (is array) | ||
if [[ $value == *"|"* ]]; then | ||
value=$(echo "$value" | tr -d '[]' | tr -d ' ') | ||
IFS='|' read -ra array <<< "$value" | ||
value=$(IFS=$'\n'; echo "${array[*]}") | ||
fi | ||
echo "$key<<EOF" >> $GITHUB_ENV | ||
echo "$value" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
done < gradle.properties | ||
- name: Read gradle.properties and set variables (Windows) | ||
if: ${{ runner.os == 'Windows' }} | ||
shell: pwsh | ||
run: | | ||
Get-Content gradle.properties | ForEach-Object { | ||
# Skip comments and empty lines | ||
if ($_ -match '^\s*#' -or $_ -match '^\s*$') { | ||
continue | ||
} | ||
$key, $value = $_ -split '=', 2 | ||
# Check if the value contains a pipe (is array) | ||
if ($value -match '\|') { | ||
$value = $value -replace '\[|\]| ' , '' | ||
$array = $value -split '\|' | ||
$value = $array -join "`n" | ||
} | ||
echo "$key=`"$value`"" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
} | ||
- name: validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: setup jdk ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
|
@@ -44,105 +69,105 @@ jobs: | |
if: ${{ runner.os != 'Windows' }} | ||
run: chmod +x ./gradlew | ||
|
||
#- name: "Run gradle task: (forge) -> datagen" | ||
# run: ./gradlew :forge:runData | ||
|
||
- name: "Run gradle task: (neoforge) -> datagen" | ||
run: ./gradlew :neoforge:runData | ||
|
||
- name: build | ||
run: ./gradlew build | ||
|
||
- name: capture build artifacts | ||
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from the latest java on one OS | ||
uses: actions/upload-artifact@v3 | ||
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/ | ||
# PUBLISH FABRIC TASK | ||
- name: publish FABRIC | ||
if: ${{ runner.os != 'Linux' }} | ||
- name: publish FORGE | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: ${{env.MODRINTH_ID}} | ||
modrinth-id: ${{env.modrinth_id}} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
modrinth-featured: true | ||
modrinth-unfeature-mode: intersection | ||
|
||
curseforge-id: ${{env.CURSEFORGE_ID}} | ||
curseforge-id: ${{env.curseforge_id}} | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
files: fabric/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
files: forge/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
|
||
name: "v${{env.VERSION}} (${{env.MC_VERSION}}) FABRIC" | ||
version: "${{env.VERSION}}" | ||
version-type: "${{env.VERSION_TYPE}}" | ||
name: "v${{env.version}} (${{env.minecraft_version}}) FORGE" | ||
version: "${{env.version}}" | ||
version-type: "${{env.version_type}}" | ||
changelog-file: changelog.md | ||
|
||
loaders: | | ||
fabric | ||
game-versions: ${{env.MC_VERSION_RANGE}} | ||
forge | ||
game-versions: ${{env.minecraft_version_range}} | ||
|
||
java: ${{ matrix.java }} | ||
|
||
retry-attempts: 2 | ||
retry-delay: 10000 | ||
fail-mode: warn | ||
|
||
# PUBLISH FORGE TASK | ||
- name: publish FORGE | ||
if: ${{ runner.os != 'Linux' }} | ||
- name: publish NEOFORGE | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: ${{env.MODRINTH_ID}} | ||
modrinth-id: ${{env.modrinth_id}} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
modrinth-featured: true | ||
modrinth-unfeature-mode: intersection | ||
|
||
curseforge-id: ${{env.CURSEFORGE_ID}} | ||
curseforge-id: ${{env.curseforge_id}} | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
files: forge/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
files: neoforge/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
|
||
name: "v${{env.VERSION}} (${{env.MC_VERSION}}) FORGE" | ||
version: "${{env.VERSION}}" | ||
version-type: "${{env.VERSION_TYPE}}" | ||
name: "v${{env.version}} (${{env.minecraft_version}}) NEOFORGE" | ||
version: "${{env.version}}" | ||
version-type: "${{env.version_type}}" | ||
changelog-file: changelog.md | ||
|
||
loaders: | | ||
forge | ||
game-versions: ${{env.MC_VERSION_RANGE}} | ||
neoforge | ||
game-versions: ${{env.minecraft_version_range}} | ||
|
||
java: ${{ matrix.java }} | ||
|
||
retry-attempts: 2 | ||
retry-delay: 10000 | ||
fail-mode: warn | ||
|
||
# PUBLISH NEOFORGE TASK | ||
- name: publish NEOFORGE | ||
if: ${{ runner.os != 'Linux' }} | ||
- name: publish FABRIC | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: ${{env.MODRINTH_ID}} | ||
modrinth-id: ${{env.modrinth_id}} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
modrinth-featured: true | ||
modrinth-unfeature-mode: intersection | ||
|
||
curseforge-id: ${{env.CURSEFORGE_ID}} | ||
curseforge-id: ${{env.curseforge_id}} | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
files: neoforge/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
files: fabric/build/libs/!(*-@(dev|sources|javadoc)).jar | ||
|
||
name: "v${{env.VERSION}} (${{env.MC_VERSION}}) NEOFORGE" | ||
version: "${{env.VERSION}}" | ||
version-type: "${{env.VERSION_TYPE}}" | ||
name: "v${{env.version}} (${{env.minecraft_version}}) FABRIC" | ||
version: "${{env.version}}" | ||
version-type: "${{env.version_type}}" | ||
changelog-file: changelog.md | ||
|
||
loaders: | | ||
neoforge | ||
game-versions: ${{env.MC_VERSION_RANGE}} | ||
fabric | ||
game-versions: ${{env.minecraft_version_range}} | ||
|
||
java: ${{ matrix.java }} | ||
|
||
|
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
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
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
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
Oops, something went wrong.