Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
be0b4e5
add --atomic on push in release script
milanmalhotra Aug 15, 2026
3695880
Merge branch 'master' of https://github.com/Blockframe-Studios/SetHom…
milanmalhotra Aug 15, 2026
0f90ebb
ci: let a labelled down-merge skip the changeset gate
milanmalhotra Aug 15, 2026
d21e197
Merge pull request #33 from Blockframe-Studios/ci/downmerge-changeset…
milanmalhotra Aug 15, 2026
304b55e
Merge branch 'dev' into masterToDevAug14
milanmalhotra Aug 15, 2026
251b9ab
Merge pull request #32 from Blockframe-Studios/masterToDevAug14
milanmalhotra Aug 15, 2026
35cddd9
feat: allow permission defaults to be overridden in config.yml
milanmalhotra Aug 15, 2026
0b8e5fe
test: assert PermissionOverrides warnings for unknown and unparseable…
milanmalhotra Aug 15, 2026
4007ab6
feat: add sh2.player and sh2.admin role bundle permissions
milanmalhotra Aug 15, 2026
b803990
fix: add structural assertions to permission bundle tests
milanmalhotra Aug 15, 2026
26c9458
feat: store the owning player name with each home
milanmalhotra Aug 15, 2026
daa5d0f
test: cover the idempotent player_name migration and fix a statement …
milanmalhotra Aug 15, 2026
cd66908
feat: resolve offline players from stored home owner names
milanmalhotra Aug 15, 2026
889f18b
fix: prevent stale player names from resolving to the wrong owner
milanmalhotra Aug 15, 2026
9b49158
fix: enforce the blacklist against the actual world, not a positional…
milanmalhotra Aug 15, 2026
19497c0
fix: deduplicate blacklist enforcement rule into a single implementation
milanmalhotra Aug 15, 2026
edf3612
refactor: fold the three blacklist commands into one
milanmalhotra Aug 15, 2026
9bd7b8e
feat: add the move-home command
milanmalhotra Aug 15, 2026
800284f
test: cover cross-world moves and the move-home usage message
milanmalhotra Aug 15, 2026
4486121
fix: match home names without regard to case when looking one up
milanmalhotra Aug 15, 2026
11946b7
feat: add go-player-home, delete-player-home and move-player-home
milanmalhotra Aug 15, 2026
1c1deeb
fix: match player names without regard to case in admin commands
milanmalhotra Aug 15, 2026
3e30d1b
fix: correct a false comment and echo stored names in admin replies
milanmalhotra Aug 15, 2026
298ff6e
feat: treat a non-material second argument as description text
milanmalhotra Aug 15, 2026
84473a3
fix: honour defaultHomeItem and cover the icon guards
milanmalhotra Aug 15, 2026
5db7ddb
feat: bare create-home and go-home use a home named default
milanmalhotra Aug 15, 2026
4c4b3fd
fix: validate the home name when creating one by command
milanmalhotra Aug 15, 2026
29a02bb
feat: add granular bypass nodes for max homes, the blacklist and tele…
milanmalhotra Aug 15, 2026
2a4486e
fix: name the home when a command cannot find it
milanmalhotra Aug 15, 2026
b1b95a5
docs: document the new commands, permission config and blacklist fix
milanmalhotra Aug 15, 2026
2c09501
fix: tell admins the real world names when the blacklist rejects one
milanmalhotra Aug 15, 2026
08baf07
fix: make config permission overrides able to deny, and enforce sh2.t…
milanmalhotra Aug 15, 2026
2414471
docs: note the two things that only bite on upgrade
milanmalhotra Aug 15, 2026
5f15836
fix: honour sh2.bypass-blacklist in the two admin routes that ignored it
milanmalhotra Aug 15, 2026
0bed378
fix: complete import-homes arguments and name the typed alias in usage
milanmalhotra Aug 15, 2026
8e5c43a
docs: changeset for the tab completion and usage message fixes
milanmalhotra Aug 15, 2026
bd1c728
feat: import the Set Homes v1 world blacklist alongside homes
milanmalhotra Aug 15, 2026
998b590
fix: resolve imported players' names from the server's player cache
milanmalhotra Aug 15, 2026
584cd98
feat: report v1 config settings with a Set Homes Two equivalent on im…
milanmalhotra Aug 15, 2026
5f61883
fix: address final review findings in the v1 import completeness work
milanmalhotra Aug 15, 2026
21eaeb2
fix version bumps
milanmalhotra Aug 16, 2026
9046e23
feat: add /setmax alias for /set-max-homes
milanmalhotra Aug 16, 2026
18098c8
Merge pull request #43 from Blockframe-Studios/migrate-sethomestwo-to…
milanmalhotra Aug 16, 2026
fd2c360
Merge remote-tracking branch 'origin/v1-parity-and-permission-config'…
milanmalhotra Aug 16, 2026
4b8b7ac
fix: report blacklist write failures and match permission nodes case-…
milanmalhotra Aug 16, 2026
173bde8
docs: reorder the README and collapse the reference material
milanmalhotra Aug 16, 2026
3399b5d
docs: cut the README back to what a server owner can act on
milanmalhotra Aug 16, 2026
f40970e
docs: bold the config.yml upgrade warning so it reads as a caution
milanmalhotra Aug 16, 2026
f3745df
update image size
milanmalhotra Aug 16, 2026
bb1c4d2
Merge pull request #42 from Blockframe-Studios/v1-parity-and-permissi…
milanmalhotra Aug 16, 2026
44d87bc
feat: tab completion matches anywhere in a name, prefix hits first
milanmalhotra Aug 16, 2026
36fa04d
Merge pull request #44 from Blockframe-Studios/issue-36-tab-completio…
milanmalhotra Aug 16, 2026
e084533
feat: report anonymous usage metrics to bStats
milanmalhotra Aug 16, 2026
39adae4
feat: developer switch to keep test servers off bStats
milanmalhotra Aug 16, 2026
3a19acf
fix: share one counter window per submission whatever order bStats asks
milanmalhotra Aug 16, 2026
93a1480
feat: line chart per alias, drop the bar and teleport source charts
milanmalhotra Aug 16, 2026
2aee4ca
fix: import case-only duplicate homes instead of dropping them
milanmalhotra Aug 17, 2026
0947e21
Merge pull request #47 from Blockframe-Studios/issue-29-bstats-metrics
milanmalhotra Aug 17, 2026
081efc9
chore: shorten comments added by the v1 duplicate-name import fix
milanmalhotra Aug 17, 2026
845cea2
Merge branch 'dev' into issue-48-case-only-duplicate-homes
milanmalhotra Aug 17, 2026
f3a557a
docs: call the plugin Set Homes, with v2 only where it sits beside v1
milanmalhotra Aug 17, 2026
1f933ff
Merge pull request #50 from Blockframe-Studios/issue-48-case-only-dup…
milanmalhotra Aug 17, 2026
87c0523
updated listing pages for bukkit, modrinth, spigotmc
milanmalhotra Aug 17, 2026
f644956
Merge branch 'dev' into issue-48-case-only-duplicate-homes
milanmalhotra Aug 17, 2026
51f25ce
Merge pull request #51 from Blockframe-Studios/issue-48-case-only-dup…
milanmalhotra Aug 17, 2026
00cdb39
fix: keep v1 colour codes out of the import report and unify the no-h…
milanmalhotra Aug 17, 2026
5a9b701
Merge pull request #52 from Blockframe-Studios/issue-49-import-report…
milanmalhotra Aug 17, 2026
c3c76f9
feat: refuse to enable when Set Homes v1 is installed alongside
milanmalhotra Aug 17, 2026
02f068c
Merge pull request #58 from Blockframe-Studios/issue-53-refuse-alongs…
milanmalhotra Aug 17, 2026
568a6a6
feat: announce v1 homes waiting to be imported
milanmalhotra Aug 17, 2026
6b6e42c
Merge pull request #59 from Blockframe-Studios/issue-54-announce-pend…
milanmalhotra Aug 17, 2026
b470419
test: assert the v1 import never writes to plugins/SetHomes/
milanmalhotra Aug 17, 2026
35704ef
feat: parse closing references out of pull request bodies
milanmalhotra Aug 17, 2026
bbf0528
feat: recover pull request numbers from a commit range
milanmalhotra Aug 17, 2026
4713ae8
feat: close the issues a release contains
milanmalhotra Aug 17, 2026
5e70e57
fix: surface gh failures in the issue-closing step instead of swallow…
milanmalhotra Aug 17, 2026
22553e2
feat: set an issue's status on the project board
milanmalhotra Aug 18, 2026
0c3ac16
feat: move issues across the board on push and pull request
milanmalhotra Aug 18, 2026
c8863cc
fix: guard the pull request status write and skip fork runs
milanmalhotra Aug 18, 2026
5c98bc5
fix: guard issue status automation against three failure modes
milanmalhotra Aug 18, 2026
4a3c41d
Merge pull request #62 from Blockframe-Studios/issue-60-issue-status-…
milanmalhotra Aug 18, 2026
46bfb85
Merge branch 'dev' into issue-57-import-never-writes-to-v1
milanmalhotra Aug 18, 2026
5db506f
fix: keep a branch under review from falling back to In progress
milanmalhotra Aug 18, 2026
0d22873
Merge branch 'dev' of https://github.com/Blockframe-Studios/SetHomesT…
milanmalhotra Aug 18, 2026
334ca42
Merge branch 'issue-57-import-never-writes-to-v1' of https://github.c…
milanmalhotra Aug 18, 2026
fec3b49
Merge pull request #61 from Blockframe-Studios/issue-57-import-never-…
milanmalhotra Aug 18, 2026
6fccfdb
update readme
milanmalhotra Aug 18, 2026
350e489
docs: correct the migration order, and add the rollback path
milanmalhotra Aug 18, 2026
a0915a2
update readme
milanmalhotra Aug 18, 2026
9610d5c
update readme
milanmalhotra Aug 18, 2026
b1787c8
Merge pull request #63 from Blockframe-Studios/issue-56-migration-ste…
milanmalhotra Aug 18, 2026
14d85fd
ci: publish to the Set Homes listing as SetHomes.V<x>.jar
milanmalhotra Aug 18, 2026
e5b1f64
Merge pull request #64 from Blockframe-Studios/issue-55-publish-to-se…
milanmalhotra Aug 18, 2026
b3ed58c
chore: use American spelling in user-facing text
milanmalhotra Aug 18, 2026
4d9cdeb
docs: say that operators hold the bypass permissions by default
milanmalhotra Aug 18, 2026
c923a5c
Merge pull request #66 from Blockframe-Studios/changeset-op-bypass-note
milanmalhotra Aug 18, 2026
e7a12cc
Merge branch 'dev' into chore-american-english-user-text
milanmalhotra Aug 18, 2026
9fb3089
Merge pull request #65 from Blockframe-Studios/chore-american-english…
milanmalhotra Aug 18, 2026
00b284e
changeset
milanmalhotra Aug 18, 2026
c582e3b
update pom to decrease generated jar file size
milanmalhotra Aug 18, 2026
e8127b3
changeset
milanmalhotra Aug 18, 2026
626ee79
Merge pull request #69 from Blockframe-Studios/decrease-jar-size
milanmalhotra Aug 18, 2026
c9c3cbc
Merge branch 'dev' of https://github.com/Blockframe-Studios/SetHomesT…
milanmalhotra Aug 18, 2026
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/brave-badgers-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: major
---

Set Homes Two can now take over from Set Homes v1. /import-homes brings your homes and world blacklist across and lists any v1 config settings that have an equivalent here, the v1 commands and aliases work again, and the plugin tells you at startup when homes are still waiting to be imported.
5 changes: 5 additions & 0 deletions .changeset/brave-otters-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Tab completion for /import-homes now offers the import sources and then confirm, instead of suggesting player names on every argument. Usage messages also name the command you actually typed, so /uhome-of now says Usage: /uhome-of rather than naming the full command behind the alias.
5 changes: 5 additions & 0 deletions .changeset/brave-pandas-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

decrease generated jar file size
5 changes: 5 additions & 0 deletions .changeset/clever-tigers-wander.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

If Set Homes v1 homes are sitting in plugins/SetHomes/homes.yml and you have not imported them yet, the console now says so at startup, naming the file, how many homes are waiting and the command to run. Anyone with sh2.import-homes gets the same reminder in chat when they join. Both stop on their own as soon as any home exists here, so an upgraded server can no longer look empty without explanation.
5 changes: 5 additions & 0 deletions .changeset/eager-badgers-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Added the Set Homes v1 admin commands. /home-of teleports you to another player's home, /delhome-of deletes one, and /uhome-of moves one to where you are standing. /uhome moves one of your own homes. All of them work on players who are offline, as long as they have saved homes, and player and home names now match without regard to case. On a server upgrading from an earlier release, each player has to log in once before the offline lookup can find them.
5 changes: 5 additions & 0 deletions .changeset/eager-seals-shine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

/sethome and /home work with no arguments again, creating and finding a home called default, which is the name an unnamed Set Homes v1 home is imported under. /sethome also takes a description straight after the name as it did in v1, so a second word that names an item is read as the icon and the reply tells you which one it chose. Put d in the icon position to keep the whole phrase as the description.
5 changes: 5 additions & 0 deletions .changeset/gentle-dolphins-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Tab completion now matches anywhere in a name, not only from the start, so typing net completes to world_nether and ase finds a home called base. Names that start with what you typed are still listed first, so nothing you already do changes.
5 changes: 5 additions & 0 deletions .changeset/gentle-foxes-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

/import-homes sethomes now lists any v1 config.yml settings that have a Set Homes Two equivalent, and the key to set each one under, so a migrating admin does not have to discover a changed teleport delay or a vanished per-group home limit by accident. Nothing is written to config.yml automatically; the report just tells you what to paste in.
5 changes: 5 additions & 0 deletions .changeset/happy-otters-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Importing from Set Homes v1 no longer loses a home whose name differs only in capitalisation. Set Homes v1 allowed one player to hold both 'base' and 'Base', while home names here ignore case, so the second one is now imported under the next free name such as 'Base2' instead of being silently dropped. The import report and the server log both name it, and the preview now reports the same numbers as the confirm that follows it.
5 changes: 5 additions & 0 deletions .changeset/kind-herons-shine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Corrected the spelling in a few of the messages the plugin sends, so they read the same way as the rest of the plugin. The wording of the teleport and import messages is otherwise unchanged. An existing config.yml is not touched, so any message you have already customized stays exactly as you set it.
5 changes: 5 additions & 0 deletions .changeset/kind-ravens-gather.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

The plugin now sends anonymous usage counts to bStats, so the maintainers can see which commands, menu buttons and settings are used, and whether database errors are happening in the wild. Nothing personal is sent, and the bStats switch in plugins/bStats/config.yml turns it off.
5 changes: 5 additions & 0 deletions .changeset/lucky-wolves-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Fixed the world blacklist only ever being enforced on the first three worlds of a server. Blacklisting any world beyond those reported success and then did nothing. It is enforced from this release on, so if you have blacklisted more than three worlds, run /blacklist list before you update. Homes in a world that starts being enforced stop being reachable by players who do not hold sh2.bypass-blacklist.
5 changes: 5 additions & 0 deletions .changeset/plain-lions-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

/blacklist add and /blacklist remove no longer report success when the database write actually failed. A failure now says so and the world is left as it was. Permission overrides in config.yml are also matched without regard to the case you write the node in, so a line like SH2.manage-homes now applies rather than being logged as applied and quietly ignored.
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.
5 changes: 5 additions & 0 deletions .changeset/quiet-otters-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

/set-max-homes now has the alias /setmax, matching Set Homes v1. Its usage message also names whichever form you typed, rather than always naming /set-max-homes.
5 changes: 5 additions & 0 deletions .changeset/quiet-otters-names.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Importing from Set Homes v1 or EssentialsX now resolves each player's name from the server's own player cache, so admin commands like /get-player-homes and /home-of work on a migrated player immediately instead of requiring them to log in first. A player the server has never seen still imports fine; they are picked up on their next join, same as before.
5 changes: 5 additions & 0 deletions .changeset/tidy-tigers-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

The Set Homes v1 import report no longer applies the colour codes found in v1 messages, so a coloured v1 message no longer turns the rest of the advice line red or unreadable. Codes are shown as an ampersand instead, and the note says where to copy the exact original from. Also, the "you have no homes yet" notice now uses the same wording and is shown as plain information rather than red from /homes, /list-homes and the homes menu alike.
5 changes: 5 additions & 0 deletions .changeset/tidy-wolves-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Permission defaults can now be changed from config.yml with no permissions plugin installed. Uncomment the permissions block and set any sh2 node to true, false, op or not-op. Two bundles, sh2.player and sh2.admin, move a whole role at once, and three new bypass permissions were added for admins: sh2.bypass-max-homes, sh2.bypass-blacklist and sh2.bypass-teleport-delay. Operators hold those three by default, the same way Set Homes v1 granted homes.config_bypass through homes.*, so an operator is not held to the teleport delay, the world blacklist or the home limit. Set any of them to false in the permissions block if you would rather they were.
5 changes: 5 additions & 0 deletions .changeset/warm-badgers-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Set Homes now refuses to start when a Set Homes v1 jar is still in your plugins folder, and the console says which file to move and what to run next. Both plugins provide /sethome, /home and /delhome and v1 wins those names, so running the two side by side used to split your players' homes between them with nothing in the log to show for it.
5 changes: 5 additions & 0 deletions .changeset/wobbly-hedgehogs-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

/import-homes sethomes now brings across the Set Homes v1 world blacklist along with the homes, so a server that had worlds blocked in v1 does not silently lose that protection on migration. Re-running the import never blacklists a world twice.
7 changes: 6 additions & 1 deletion .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: Changeset
# Its own workflow rather than a job in Tests: a job skipped by an `if:` still
# reports a check run, so the push event would publish a second, skipped
# "changeset" result for the same commit.
on: pull_request
on:
pull_request:
# labeled and unlabeled so applying the downmerge label re-runs the gate.
types: [opened, synchronize, reopened, labeled, unlabeled]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,6 +27,8 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
PR_BASE: ${{ github.event.pull_request.base.ref }}
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }}
run: |
set -euo pipefail
# Written to a file rather than piped, so a failing gh call cannot be
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/issue-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Issue status

# Moves issues across the project board as their work progresses. GitHub does
# not link an issue to a pull request based on dev, so the closing keywords are
# parsed out of the body here rather than read back from the API.
on:
push:
branches: ['issue-*']
pull_request:
types: [opened, reopened, ready_for_review, edited, closed]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions: {}

env:
PROJECT_NUMBER: '1'
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}

jobs:
in-progress:
# A branch deletion after its pull request merges can also fire a push
# event, with no branch left to check out.
if: github.event_name == 'push' && github.event.deleted == false
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Move the issue along
env:
BRANCH: ${{ github.ref_name }}
run: |
set -uo pipefail
source scripts/issue-status.sh

issue="$(printf '%s' "$BRANCH" | sed -nE 's/^issue-([0-9]+)-.*/\1/p')"
if [ -z "$issue" ]; then
echo "Branch $BRANCH does not name an issue - nothing to do."
exit 0
fi

# Pushing to a branch that is already under review, by merging the
# base branch in for example, must not report it as in progress.
# synchronize is not a trigger type, so this job is the only thing
# that runs on such a push.
if [ "$(gh pr list --head "$BRANCH" --state open --json number --jq 'length')" = "0" ]; then
state="none"
else
state="open-pr"
fi

mapfile -t plan < <(push_plan "$state")
bash scripts/set-issue-status.sh "$issue" "${plan[0]}" "${plan[@]:1}"

pull-request:
# Fork runs get no secrets, so GH_TOKEN would be empty and every external
# contribution would show a red check it has no way to fix.
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Move the referenced issues
env:
# Through the environment, never interpolated into the script: a body
# is attacker controllable text.
BODY: ${{ github.event.pull_request.body }}
MERGED: ${{ github.event.pull_request.merged }}
BASE: ${{ github.event.pull_request.base.ref }}
ACTION: ${{ github.event.action }}
run: |
set -uo pipefail
source scripts/issue-status.sh

if [ "$ACTION" = "closed" ]; then
if [ "$MERGED" != "true" ] || [ "$BASE" != "dev" ]; then
echo "Closed without merging into dev - nothing to do."
exit 0
fi
status="Ready for release"
# Every state except Done: a merge into dev always beats an
# earlier state, but a down-merge from master can repeat a
# Closes reference for an issue that already shipped, and that
# must not drag it backwards out of Done.
allowed=(Todo unset "In progress" "In review" "Ready for release")
else
status="In review"
# Guards an edit on an already merged pull request from pulling
# the issue back out of Ready for release or Done.
allowed=(Todo unset "In progress")
fi

refs="$(printf '%s' "$BODY" | closing_refs)"
if [ -z "$refs" ]; then
echo "No closing references in the body - nothing to do."
exit 0
fi

failures=0
while IFS= read -r issue; do
[ -n "$issue" ] || continue
if ! bash scripts/set-issue-status.sh "$issue" "$status" "${allowed[@]}"; then
printf 'FAILED: could not set #%s to %s\n' "$issue" "$status" >&2
failures=$((failures + 1))
fi
done <<< "$refs"

if [ "$failures" -gt 0 ]; then
exit 1
fi
44 changes: 40 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ concurrency:

permissions:
contents: write
issues: write
pull-requests: read

jobs:
release:
Expand Down Expand Up @@ -96,6 +98,17 @@ jobs:
echo "current=$CURRENT"
echo "next=$NEXT"

- name: Dry run - list the issues this release would close
if: steps.plan.outputs.release == 'true' && inputs.dry_run
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.plan.outputs.next }}
DRY_RUN: '1'
run: |
set -uo pipefail
PREV_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)" \
bash scripts/close-released-issues.sh

- name: Dry run - resolve BukkitDev game versions
if: steps.plan.outputs.release == 'true' && inputs.dry_run
env:
Expand All @@ -116,6 +129,17 @@ jobs:
end
'

# Must run before Commit and tag creates v$NEXT, or the range below is
# empty and nothing closes.
- name: Record the previous release tag
id: prev
if: steps.plan.outputs.release == 'true'
run: |
set -uo pipefail
tag="$(git describe --tags --abbrev=0 2>/dev/null || true)"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "Previous release tag: ${tag:-none}"

- name: Commit and tag
if: steps.plan.outputs.release == 'true' && !inputs.dry_run
env:
Expand All @@ -126,15 +150,15 @@ jobs:
git add pom.xml README.md .changeset
git commit -m "chore(release): $NEXT"
git tag -a "v$NEXT" -m "Release $NEXT"
git push origin HEAD:master --follow-tags
git push --atomic origin HEAD:master --follow-tags
git ls-remote --exit-code --tags origin "refs/tags/v$NEXT" > /dev/null \
|| { echo "Tag v$NEXT did not reach the remote"; exit 1; }

- name: Rename the jar to the release convention
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 @@ -150,6 +174,18 @@ 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
# being released. That is what keeps work sitting on dev open when an
# immediate fix ships from master, and closes an immediate fix that never
# passed through dev.
- name: Close the issues this release contains
if: steps.plan.outputs.release == 'true' && !inputs.dry_run
env:
GH_TOKEN: ${{ github.token }}
PREV_TAG: ${{ steps.prev.outputs.tag }}
VERSION: ${{ steps.plan.outputs.next }}
run: bash scripts/close-released-issues.sh
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ jobs:
- name: Build and test
run: mvn -B verify

- name: Prove the shaded libraries were relocated
run: |
jar="$(ls target/SetHomesTwo-*.jar | head -n 1)"
listing="$(unzip -l "$jar")"
if echo "$listing" | grep -q ' org/bstats/'; then
echo "org.bstats was not relocated"; exit 1
fi
if ! echo "$listing" | grep -q ' com/samleighton/sethomestwo/lib/bstats/'; then
echo "relocated bstats classes are missing"; exit 1
fi
if echo "$listing" | grep -q ' net/wesjd/'; then
echo "anvilgui was not relocated"; exit 1
fi

- name: Run the release script tests
run: bash scripts/test-release.sh

Expand All @@ -37,6 +51,9 @@ jobs:
- name: Run the BukkitDev publish tests
run: bash scripts/test-publish-bukkitdev.sh

- name: Run the issue status parsing tests
run: bash scripts/test-issue-status.sh

# Rehearses the release on every pull request. The changelog heading went
# missing in a docs change, and nothing noticed until a release ran.
- name: Check a release could be applied
Expand Down
Loading
Loading