Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-herons-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Set Homes now publishes to the original Set Homes project page, so servers running the older Set Homes are offered this as an update on the page they already watch. The download is named SetHomes rather than SetHomesTwo. The plugin folder and your existing config.yml are unaffected.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
if: steps.plan.outputs.release == 'true' && !inputs.dry_run
env:
NEXT: ${{ steps.plan.outputs.next }}
run: cp "target/SetHomesTwo-$NEXT.jar" "SetHomesTwo.V$NEXT.jar"
run: cp "target/SetHomesTwo-$NEXT.jar" "SetHomes.V$NEXT.jar"

- name: Publish to BukkitDev
if: steps.plan.outputs.release == 'true' && !inputs.dry_run
Expand All @@ -174,8 +174,8 @@ jobs:
VERSION: ${{ steps.plan.outputs.next }}
run: |
NOTES=$(bash scripts/release.sh notes --readme README.md --version "$VERSION")
gh release create "v$VERSION" "SetHomesTwo.V$VERSION.jar" \
--title "SetHomesTwo V$VERSION" \
gh release create "v$VERSION" "SetHomes.V$VERSION.jar" \
--title "Set Homes V$VERSION" \
--notes "$NOTES"

# An issue closes when the commit that fixed it is contained in the commit
Expand Down
17 changes: 13 additions & 4 deletions scripts/publish-bukkitdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@ set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# 913275 is set-homes-two. Not 312833 - that is Set Homes v1.
PROJECT_ID=913275
# 312833 is the Set Homes listing, the one v1 servers already watch for updates.
PROJECT_ID=312833
API=https://dev.bukkit.org/api

if [ -z "${CURSEFORGE_TOKEN:-}" ]; then
echo "CURSEFORGE_TOKEN is not set" >&2
exit 1
fi

# This listing carries Set Homes v1, which last shipped 1.3.1, so anything below
# 2.0.0 would reach those servers as an update that reads as a downgrade.
case "$VERSION" in
0.*|1.*)
echo "$VERSION is below the 2.0.0 floor for this listing, refusing to publish" >&2
exit 1
;;
esac

GAME_VERSIONS=$(curl -sS -H "X-Api-Token: $CURSEFORGE_TOKEN" "$API/game/versions" \
| jq -f "$SCRIPT_DIR/game-versions.jq" \
| jq -c 'map(.id)')
Expand All @@ -40,7 +49,7 @@ CHANGELOG=$(bash "$SCRIPT_DIR/release.sh" notes --readme README.md --version "$V
# backslashes and newlines.
METADATA=$(jq -n \
--arg changelog "$CHANGELOG" \
--arg displayName "SetHomesTwo V$VERSION" \
--arg displayName "Set Homes V$VERSION" \
--argjson gameVersions "$GAME_VERSIONS" \
'{
changelog: $changelog,
Expand All @@ -55,7 +64,7 @@ METADATA=$(jq -n \
RESPONSE=$(curl -sS -w '\n%{http_code}' -X POST "$API/projects/$PROJECT_ID/upload-file" \
-H "X-Api-Token: $CURSEFORGE_TOKEN" \
--form-string "metadata=$METADATA" \
-F "file=@SetHomesTwo.V$VERSION.jar")
-F "file=@SetHomes.V$VERSION.jar")

BODY=$(echo "$RESPONSE" | head -n -1)
CODE=$(echo "$RESPONSE" | tail -n 1)
Expand Down
24 changes: 22 additions & 2 deletions scripts/test-publish-bukkitdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,37 @@ else
fi

DISPLAY_NAME=$(printf '%s' "$METADATA" | jq -r '.displayName // ""' 2>/dev/null)
if [ "$DISPLAY_NAME" = "SetHomesTwo V9.9.9" ]; then
if [ "$DISPLAY_NAME" = "Set Homes V9.9.9" ]; then
pass "names the file after the version"
else
fail "names the file after the version" "got: $DISPLAY_NAME"
fi

if has_arg "file=@SetHomesTwo.V9.9.9.jar"; then
if has_arg "file=@SetHomes.V9.9.9.jar"; then
pass "uploads the versioned jar"
else
fail "uploads the versioned jar" "args were: $(args_summary)"
fi

# The listing this publishes to carries Set Homes v1, which shipped 1.3.1, so a
# 1.x upload would be offered to those servers as an update. The guard runs
# before the first API call, so a refused run records no curl at all.
REFUSE_ARGS_DIR="$WORK/args-refused"
REFUSE_OUTPUT=$(cd "$WORK/run" && PATH="$WORK/bin:$PATH" CURSEFORGE_TOKEN=test-token \
VERSION=1.2.3 CURL_ARGS_DIR="$REFUSE_ARGS_DIR" bash "$PUBLISH_SH" 2>&1)
REFUSE_STATUS=$?

if [ "$REFUSE_STATUS" -ne 0 ]; then
pass "refuses to publish a version below 2.0.0"
else
fail "refuses to publish a version below 2.0.0" "exited 0: $REFUSE_OUTPUT"
fi

if [ ! -d "$REFUSE_ARGS_DIR" ]; then
pass "calls nothing when it refuses"
else
fail "calls nothing when it refuses" "recorded: $(ls "$REFUSE_ARGS_DIR")"
fi

printf '\n%d passed, %d failed\n' "$PASS" "$FAIL"
[ "$FAIL" -eq 0 ]
Loading