Skip to content

Commit

Permalink
Merge branch '1.21.2' into 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 20, 2024
2 parents 5b23b0f + e7b510a commit a354b18
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
62 changes: 44 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

- name: Create and push tag
run: |
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
git config --global user.name "Wurst-Bot"
git config --global user.email "[email protected]"
git tag "v$MOD_VERSION"
Expand All @@ -92,35 +92,61 @@ jobs:
GITHUB_TOKEN: ${{ secrets.MCX_PUBLISH_TOKEN }}
run: ./gradlew github --stacktrace

- name: Publish to CurseForge
- name: Publish to CurseForge
if: ${{ inputs.publish_curseforge }}
run: ./gradlew publishCurseforge --stacktrace

- name: Get CurseForge file ID
id: cf_file_id
if: ${{ inputs.publish_curseforge }}
run: |
file_id=$(./gradlew getCurseforgeId | grep -o 'CURSEFORGE_FILE_ID=[0-9]*' | grep -o '[0-9]*')
file_id=$(./gradlew getCurseforgeId -x publishCurseforge | grep -o 'CURSEFORGE_FILE_ID=[0-9]*' | grep -o '[0-9]*')
echo "file_id=$file_id" >> "$GITHUB_OUTPUT"
echo "CurseForge file ID: `$file_id`" >> $GITHUB_STEP_SUMMARY
echo "CurseForge file ID: \`$file_id\`" >> $GITHUB_STEP_SUMMARY
- name: Publish to Modrinth
if: ${{ inputs.publish_modrinth }}
run: ./gradlew publishModrinth --stacktrace

- name: Trigger website update
- name: Build website update inputs
id: website_inputs
if: ${{ inputs.update_website && inputs.publish_curseforge }}
env:
GH_TOKEN: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }}
run: |
MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/-MC.*$//')
MC_VERSION=$(grep "minecraft_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
FAPI_VERSION=$(grep "fabric_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
gh workflow run add_mod_port.yml \
-R Wurst-Imperium/wimods.net \
-f mod="mo-glass" \
-f modloader="fabric" \
-f mod_version="$MOD_VERSION" \
-f mc_version="$MC_VERSION" \
-f fapi_version="$FAPI_VERSION" \
-f file_id="${{ steps.cf_file_id.outputs.file_id }}"
MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/-MC.*$//')
MC_VERSION=$(grep "^minecraft_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
FAPI_VERSION=$(grep "^fabric_version=" gradle.properties | cut -d'=' -f2 | tr -d ' \r')
JSON_STRING=$(cat << EOF
{
"mod": "mo-glass",
"modloader": "fabric",
"mod_version": "$MOD_VERSION",
"mc_version": "$MC_VERSION",
"fapi_version": "$FAPI_VERSION",
"file_id": "${{ steps.cf_file_id.outputs.file_id }}"
}
EOF
)
# Convert to single line and escape quotes
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
- name: Trigger website update
id: website_dispatch
if: ${{ inputs.update_website && inputs.publish_curseforge }}
uses: codex-/return-dispatch@v2
with:
token: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }}
owner: Wurst-Imperium
repo: wimods.net
ref: master
workflow: add_mod_port.yml
workflow_inputs: ${{ steps.website_inputs.outputs.json }}

- name: Wait for website update to finish (run ${{ steps.website_dispatch.outputs.run_id }})
if: ${{ inputs.update_website && inputs.publish_curseforge }}
uses: codex-/await-remote-run@v1
with:
token: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }}
owner: Wurst-Imperium
repo: wimods.net
run_id: ${{ steps.website_dispatch.outputs.run_id }}
run_timeout_seconds: 600 # 10 minutes
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ loader_version=0.16.9
fabric_version=0.110.0+1.21.1

# Mod Properties
mod_version = 1.10.1-MC1.21.1
maven_group = net.wurstclient.glass
archives_base_name = Mo-Glass
mod_version=1.10.1-MC1.21.1
maven_group=net.wurstclient.glass
archives_base_name=Mo-Glass

# CurseForge
cf_game_version=1.21.1
Expand Down

0 comments on commit a354b18

Please sign in to comment.