Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
changelog: see changelog.md
  • Loading branch information
sa-shiro committed Apr 19, 2024
1 parent 8b03843 commit 67556d7
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 109 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#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: "v1.4.3 - 1.20.2"

name: build
on: [ push, pull_request, workflow_dispatch ]
Expand All @@ -17,38 +11,34 @@ jobs:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
# Chekout Repo
- name: checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Validate gradle wrapper
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

# Setup JDKs
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

# Make gradle wrapper executable (linux)
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

# Run DataGenerator (forge)
#- name: "Run gradle task: (forge) -> datagen"
# run: ./gradlew :forge:runData

- name: "Run gradle task: (neoforge) -> datagen"
run: ./gradlew :neoforge:runData

# Build Project (common, forge, neoforge, fabric)
- name: build
run: ./gradlew build

# Capture bould artifacts
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: |
Expand Down
135 changes: 80 additions & 55 deletions .github/workflows/publish.yml
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:
Expand All @@ -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'
Expand All @@ -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 }}

Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ subprojects {
"forge_version_range": forge_version_range,
"loader_version_range": loader_version_range,
"forge_mc_version_range": forge_mc_version_range,
"java_version_range": java_version_range,
"fabric_version": fabric_version,
"fabric_loader_version": fabric_loader_version,
"fabric_version_range": fabric_version_range,
Expand All @@ -82,8 +81,7 @@ subprojects {
"modrinth_page": modrinth_page,
"source": project.source,
"update_url": update_url,
"homepage": homepage,
"discord": discord
"homepage": homepage
]

filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) {
Expand Down
6 changes: 2 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# v1.4.3 [ 1.20.2 ]
# v1.4.4 [ 1.20.2 ]

## General

- Added NeoForge Support
- Added Blocks: `Crimson Stem`, `Warped Stem` `TNT (Warning!!! ignitable but explosion radius like regular TNT)`
- Added Achievement: `TNT Addiction`
- fixed `TNT Addiction` advancement title name


- Compatible with: `[ 1.20, 1.20.1, 1.20.2 ]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"icon": {
"item": "compressedblocks:c9_tnt"
},
"title": "Cobbletone Addiction: X",
"title": "Total Domination",
"description": "§4Reach the final compression level with: §2TNT§4!",
"frame": "challenge",
"show_toast": true,
Expand Down
4 changes: 1 addition & 3 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"contact": {
"sources": "${source}",
"issues": "${source}/issues",
"discord": "${discord}",
"curseforge": "${curseforge_page}",
"modrinth": "${modrinth_page}",
"homepage": "${homepage}",
Expand All @@ -29,8 +28,7 @@
},
"depends": {
"fabricloader": "${fabric_version_range}",
"minecraft": "${fabric_mc_version_range}",
"java": "${java_version_range}"
"minecraft": "${fabric_mc_version_range}"
},
"suggests": {}
}
Expand Down
Loading

0 comments on commit 67556d7

Please sign in to comment.