Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus committed Aug 16, 2024
1 parent 774882a commit f54af7f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
MC=$(awk -F '=' '/mc_version/ { print $2; }' gradle.properties)
BUILD=$(awk -F '=' '/build_number/ { print $2; }' gradle.properties)
echo "forge=Forge/build/libs/Neat-${MC}-${BUILD}-FORGE.jar" >> "$GITHUB_OUTPUT"
echo "neoforge=NeoForge/build/libs/Neat-${MC}-${BUILD}-NEOFORGE.jar" >> "$GITHUB_OUTPUT"
echo "fabric=Fabric/build/libs/Neat-${MC}-${BUILD}-FABRIC.jar" >> "$GITHUB_OUTPUT"
- name: Sign jars
env:
Expand All @@ -44,16 +44,16 @@ jobs:
run: |
echo "${SIGNING_KEY}" | gpg --import -
gpg --local-user "Violet Moon Signing Key" --armor \
--detach-sign ${{ steps.calculate_artifact_names.outputs.forge }}
--detach-sign ${{ steps.calculate_artifact_names.outputs.neoforge }}
gpg --local-user "Violet Moon Signing Key" --armor \
--detach-sign ${{ steps.calculate_artifact_names.outputs.fabric }}
- name: Archive Forge Artifacts
- name: Archive NeoForge Artifacts
uses: actions/upload-artifact@v2
with:
name: Forge
name: NeoForge
path: |
${{ steps.calculate_artifact_names.outputs.forge }}
${{ steps.calculate_artifact_names.outputs.forge }}.asc
${{ steps.calculate_artifact_names.outputs.neoforge }}
${{ steps.calculate_artifact_names.outputs.neoforge }}.asc
- name: Archive Fabric Artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -67,7 +67,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
GIT_REF: ${{ github.ref }}
FABRIC_JAR: ${{ steps.calculate_artifact_names.outputs.fabric }}
FORGE_JAR: ${{ steps.calculate_artifact_names.outputs.forge }}
NEOFORGE_JAR: ${{ steps.calculate_artifact_names.outputs.neoforge }}
CURSEFORGE_TOKEN: ${{ secrets.VAZKII_CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.VAZKII_MODRINTH_TOKEN }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.diffplug.spotless' version '5.12.5' apply false
id 'com.diffplug.spotless' version '6.25.0' apply false
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ org.gradle.jvmargs=-Xmx2G \
group=vazkii.neat
neoforge_version=21.1.1
mod_id=neat
build_number=37
build_number=36
mod_name=Neat
mc_version=1.21
42 changes: 21 additions & 21 deletions scripts/upload_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function release_github() {
echo >&2 'Uploading Fabric Jar and Signature to GitHub'
gh release upload "${TAGNAME}" "${FABRIC_JAR}#Fabric Jar"
gh release upload "${TAGNAME}" "${FABRIC_JAR}.asc#Fabric Signature"
echo >&2 'Uploading Forge Jar and Signature to GitHub'
gh release upload "${TAGNAME}" "${FORGE_JAR}#Forge Jar"
gh release upload "${TAGNAME}" "${FORGE_JAR}.asc#Forge Signature"
echo >&2 'Uploading NeoForge Jar and Signature to GitHub'
gh release upload "${TAGNAME}" "${NEOFORGE_JAR}#NeoForge Jar"
gh release upload "${TAGNAME}" "${NEOFORGE_JAR}.asc#Forge Signature"
}

function release_modrinth() {
Expand Down Expand Up @@ -60,13 +60,13 @@ EOF
-F "data=$MODRINTH_FABRIC_SPEC" \
-F "jar=@${FABRIC_JAR}" # TODO modrinth doesn't allow asc files. Remember to readd "signature" to the spec when reenabling this. \ -F "signature=@${FABRIC_JAR}.asc"

echo >&2 'Uploading Forge Jar to Modrinth'
local MODRINTH_FORGE_SPEC
MODRINTH_FORGE_SPEC=$(cat <<EOF
echo >&2 'Uploading NeoForge Jar to Modrinth'
local MODRINTH_NEOFORGE_SPEC
MODRINTH_NEOFORGE_SPEC=$(cat <<EOF
{
"dependencies": [],
"version_type": "release",
"loaders": ["forge"],
"loaders": ["neoforge"],
"featured": false,
"project_id": "Ins7SzzR",
"file_parts": [
Expand All @@ -77,25 +77,25 @@ EOF
EOF
)

MODRINTH_FORGE_SPEC=$(echo "${MODRINTH_FORGE_SPEC}" | \
jq --arg name "${VERSION}-forge" \
MODRINTH_NEOFORGE_SPEC=$(echo "${MODRINTH_NEOFORGE_SPEC}" | \
jq --arg name "${VERSION}-neoforge" \
--arg mcver "${MC_VERSION}" \
--arg changelog "${GH_RELEASE_PAGE}" \
'.name=$ARGS.named.name | .version_number=$ARGS.named.name | .game_versions=[$ARGS.named.mcver] | .changelog=$ARGS.named.changelog')
curl 'https://api.modrinth.com/v2/version' \
-H "Authorization: $MODRINTH_TOKEN" \
-F "data=$MODRINTH_FORGE_SPEC" \
-F "jar=@${FORGE_JAR}" # TODO modrinth doesn't allow asc files. Remember to readd "signature" to the spec when reenabling this. \ -F "signature=@${FORGE_JAR}.asc"
-F "data=$MODRINTH_NEOFORGE_SPEC" \
-F "jar=@${NEOFORGE_JAR}" # TODO modrinth doesn't allow asc files. Remember to readd "signature" to the spec when reenabling this. \ -F "signature=@${NEOFORGE_JAR}.asc"
}

function release_curseforge() {
# Java versions, Loaders, and Environment tags are actually "game versions" (lmfao), as are real game versions.

# Hardcoded from https://minecraft.curseforge.com/api/game/versions
# I'm not betting on these changing any time soon, so hardcoding is ok
local CURSEFORGE_JAVA_VERSION=8326 # Java 17
local CURSEFORGE_JAVA_VERSION=11135 # Java 21
local CURSEFORGE_FABRIC_VERSION=7499
local CURSEFORGE_FORGE_VERSION=7498
local CURSEFORGE_NEOFORGE_VERSION=10150
local CURSEFORGE_CLIENT_VERSION=9638
# For the Minecraft one, don't hardcode so we don't have to remember to come change this every time.
# Each game version seems to be duplicated three times:
Expand Down Expand Up @@ -143,29 +143,29 @@ $CURSEFORGE_GAME_VERSION]"
# TODO: Upload the asc as an 'Additional file'

echo >&2 'Uploading Forge Jar to CurseForge'
local CURSEFORGE_FORGE_SPEC
CURSEFORGE_FORGE_SPEC=$(cat <<EOF
local CURSEFORGE_NEOFORGE_SPEC
CURSEFORGE_NEOFORGE_SPEC=$(cat <<EOF
{
"changelogType": "text",
"releaseType": "release"
}
EOF
)

local CURSEFORGE_FORGE_GAMEVERS="[\
local CURSEFORGE_NEOFORGE_GAMEVERS="[\
$CURSEFORGE_JAVA_VERSION,\
$CURSEFORGE_CLIENT_VERSION,\
$CURSEFORGE_FORGE_VERSION,\
$CURSEFORGE_NEOFORGE_VERSION,\
$CURSEFORGE_GAME_VERSION]"

CURSEFORGE_FORGE_SPEC=$(echo "$CURSEFORGE_FORGE_SPEC" | \
CURSEFORGE_NEOFORGE_SPEC=$(echo "$CURSEFORGE_NEOFORGE_SPEC" | \
jq --arg changelog "$GH_RELEASE_PAGE" \
--argjson gamevers "$CURSEFORGE_FORGE_GAMEVERS" \
--argjson gamevers "$CURSEFORGE_NEOFORGE_GAMEVERS" \
'.gameVersions=$ARGS.named.gamevers | .changelog=$ARGS.named.changelog')
curl 'https://minecraft.curseforge.com/api/projects/238372/upload-file' \
-H "X-Api-Token: $CURSEFORGE_TOKEN" \
-F "metadata=$CURSEFORGE_FORGE_SPEC" \
-F "file=@$FORGE_JAR"
-F "metadata=$CURSEFORGE_NEOFORGE_SPEC" \
-F "file=@$NEOFORGE_JAR"
# TODO: Upload the asc as an 'Additional file'
}

Expand Down

0 comments on commit f54af7f

Please sign in to comment.