From 12dea0add2be02210bdf66137f61c34c47cbe983 Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Wed, 4 Nov 2026 09:07:10 +0000 Subject: [PATCH] Set up CurseForge alpha publishing --- .github/workflows/publish-release.yml | 146 ++++++++++++++++++++++++++ CHANGELOG.txt | 92 +++++----------- README.md | 5 +- docs/DEVELOPMENT.md | 18 ++++ scripts/prepare-alpha.sh | 28 +++++ 5 files changed, 220 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/publish-release.yml create mode 100644 scripts/prepare-alpha.sh diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..b782832 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,146 @@ +name: Publish Iron Age Architecture alpha + +run-name: "${{ inputs.confirm_live_publication && 'Publish' || 'Check' }} ${{ inputs.release_version }} to CurseForge" + +on: + workflow_dispatch: + inputs: + release_version: + description: Version from gradle.properties, including .110021. + required: true + type: string + release_sha: + description: Full SHA of the merged master-1.10 commit. + required: true + type: string + build_run_id: + description: Successful Build run from that commit's push to master-1.10. + required: true + type: string + player_sha256: + description: SHA-256 of the tested player JAR. + required: true + type: string + confirm_live_publication: + description: Upload the checked JAR to CurseForge as an alpha. + default: false + type: boolean + +permissions: + actions: read + contents: read + +concurrency: + group: architecture-alpha-${{ inputs.release_version }} + cancel-in-progress: false + +jobs: + alpha: + name: Check and publish the alpha + runs-on: ubuntu-latest + timeout-minutes: 10 + env: + GH_TOKEN: ${{ github.token }} + RELEASE_VERSION: ${{ inputs.release_version }} + RELEASE_SHA: ${{ inputs.release_sha }} + BUILD_RUN_ID: ${{ inputs.build_run_id }} + PLAYER_SHA256: ${{ inputs.player_sha256 }} + PUBLISH: ${{ inputs.confirm_live_publication }} + + steps: + - name: Check the release and its build + run: | + set -euo pipefail + [[ "$GITHUB_REPOSITORY" == 'MinecraftModDevelopmentMods/IronAgeArchitecture' ]] + [[ "$GITHUB_REF" == 'refs/heads/master-1.10' ]] + [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.110021$ ]] + [[ "$RELEASE_SHA" =~ ^[0-9a-f]{40}$ && "$RELEASE_SHA" == "$GITHUB_SHA" ]] + [[ "$PLAYER_SHA256" =~ ^[0-9a-f]{64}$ && "$BUILD_RUN_ID" =~ ^[0-9]+$ ]] + current_sha="$(gh api "repos/$GITHUB_REPOSITORY/branches/master-1.10" --jq '.commit.sha')" + [[ "$current_sha" == "$RELEASE_SHA" ]] + + gh api "repos/$GITHUB_REPOSITORY/actions/runs/$BUILD_RUN_ID" | + jq -e --arg sha "$RELEASE_SHA" --arg repo "$GITHUB_REPOSITORY" ' + .path == ".github/workflows/ci.yml" and .event == "push" and + .head_branch == "master-1.10" and .head_sha == $sha and + .head_repository.full_name == $repo and .conclusion == "success" + ' > /dev/null + + if [[ "$PUBLISH" == true ]]; then + if [[ "$GITHUB_RUN_ATTEMPT" != 1 ]]; then + echo 'Check the previous upload in CurseForge before starting another run.' >&2 + exit 1 + fi + # A previous upload may still be in moderation even if its workflow failed. + earlier_runs="$(gh api --paginate \ + "repos/$GITHUB_REPOSITORY/actions/workflows/publish-release.yml/runs?event=workflow_dispatch&per_page=100" | + jq -r --arg title "Publish $RELEASE_VERSION to CurseForge" --arg current "$GITHUB_RUN_ID" ' + .workflow_runs[] | select(.display_title == $title and (.id | tostring) != $current) | .id + ')" + for run in $earlier_runs; do + jobs="$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$run/jobs?filter=all")" + if jq -e 'any(.jobs[].steps[]?; + .name == "Upload alpha to CurseForge" and + (.status == "in_progress" or (.status == "completed" and .conclusion != "skipped")) + )' <<< "$jobs" > /dev/null; then + echo "Run $run already attempted this upload. Check the file in CurseForge." >&2 + exit 1 + fi + done + fi + + - name: Check out the merged source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ inputs.release_sha }} + persist-credentials: false + + - name: Download the checked build + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: iron-age-architecture-1.10.2 + path: ${{ runner.temp }}/architecture-build + run-id: ${{ inputs.build_run_id }} + github-token: ${{ github.token }} + + - name: Check the player JAR and prepare its notes + run: bash scripts/prepare-alpha.sh "$RUNNER_TEMP/architecture-build" "$RUNNER_TEMP/architecture-alpha" + + - name: Check upload credentials + if: inputs.confirm_live_publication + env: + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + run: | + if [[ -z "$CURSEFORGE_TOKEN" ]]; then + echo 'The CURSEFORGE_TOKEN Actions secret is missing.' >&2 + exit 1 + fi + + - name: Upload alpha to CurseForge + id: upload + if: inputs.confirm_live_publication + uses: Kira-NT/mc-publish@52307b03863581dec6b652b83e597aec02ebb075 # v3.3.1 + with: + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + curseforge-id: '1779832' + name: Iron Age Architecture ${{ inputs.release_version }} for Minecraft 1.10.2 (Forge) + version: ${{ inputs.release_version }} + version-type: alpha + changelog-file: ${{ runner.temp }}/architecture-alpha/CHANGELOG.md + loaders: forge + game-versions: '1.10.2' + game-version-filter: none + environment: client | server + java: Java 8 + fail-mode: fail + retry-attempts: 1 + files: ${{ runner.temp }}/architecture-alpha/iron-age-architecture-${{ inputs.release_version }}.jar + + - name: Record the upload + if: inputs.confirm_live_publication + env: + FILES: ${{ steps.upload.outputs.curseforge-files }} + run: | + set -euo pipefail + file_id="$(jq -er 'if length == 1 then .[0].id | tostring | select(test("^[0-9]+$")) else empty end' <<< "$FILES")" + echo "CurseForge accepted [file $file_id](https://www.curseforge.com/minecraft/mc-mods/ironagearchitecture/files/$file_id)." >> "$GITHUB_STEP_SUMMARY" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 67f978a..bd3c20a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,71 +1,27 @@ -0.1.8.110021 - Horizontal rails (unreleased) - -- Joined rails through posts to matching corners and other timbers, closing the gaps - between window framing and the corner posts. -- Stopped corner pieces adding horizontal returns on an unconnected side. -- Trimmed the backs of corner rails to the inside post so their cut ends do not show - through the adjoining wall. -- Added close-up exterior and interior views to the new Horizontal Rails Preview. - - -0.1.7.110021 - Timber joins (unreleased) - -- Fixed short rail ends sticking out beyond the posts or studs they should meet. -- Made automatic rails finish on diagonal braces at the right height, including thin - walls and short pieces. Continuous rail runs keep their full width. -- Filled the small missing corners where diagonal beams cross between blocks, so - the timber keeps its width through the joint. The joins follow the neighbouring wood. -- Corrected the diagonal bracing on half-step upper floors in the preview street. - The new Timber Joins Preview keeps the earlier saves available for comparison. - - -0.1.6.110021 - Leaded windows (unreleased) - -- Added openable leaded windows to the Late Medieval & Tudor palette, with diamond - or rectangular leading, all six woods, and raw or limewashed surrounds. -- Added full and half-depth frames that fit the existing walls and jettied upper floors. - Stack matching sections for taller casements, or place columns side by side. -- Casements swing outwards. Right-click the frame or open pane to operate a column; - redstone works too. Neighbouring columns can be opened separately. -- Windows check the whole column before opening, so an obstruction leaves it closed. -- Craft leaded panes from glass panes and iron, then add one to a matching post panel. - Shape the panels before glazing. Leading swaps one-for-one, and raw surrounds can - be limewashed singly or in batches. - - -0.1.5.110021 - Crafting (unreleased) - -- Made plain wattle and daub the starting material for timber wall panels. -- Gave full, thin and short walls the same pattern recipes. Arrange three post panels - in a row, column, diagonal or L to make rails, studs, braces or corner/end panels. -- Made paired designs swap one-for-one without extra sticks. Patterned wall panels - can be reshaped back into post panels. -- Added the missing ways to rejoin thin walls and recover shaped corner pieces. -- Added single and batch limewashing for every raw cob and daub shape, including stairs. -- Added crafting hints to the building pieces and rewrote the crafting guide around the new chains. -- Made brackets from matching timber floors and made roof ridges reversible. -- Increased the cob stair recipe to eight stairs and added recovery recipes so shaping - does not waste material. - - -0.1.4.110021 - Jetty brackets (unreleased) - -- Fixed the diagonal supports beneath jetties looking hollow and flickering where - they meet the beams. - - -0.1.3.110021 - Walls and era palettes (unreleased) - -- Tidied up overlapping timber faces to stop flickering at posts, rails and corners. -- Closed the gap above lower walls beneath jettied floors with a matching timber beam. - The open space beneath the projecting part of the floor stays clear. -- Grouped the building kit into Iron Age and Late Medieval & Tudor creative tabs. - Cob, plain daub and thatch appear in both palettes. -- Added a survival recipe setting for choosing one or more eras. Shared materials - stay craftable when an enabled era uses them. Everything is enabled by default. - - -0.1.2.110021 - First alpha (unreleased) +0.1.8.110021 - Alpha + +This update adds openable leaded windows and tidies up the timber framing. The village +kit is easier to craft, and you can now choose which building eras to use in survival. + +- Added diamond and rectangular leaded windows in all six woods, with raw or limewashed + surrounds. Full and half-depth frames fit ordinary walls and projecting upper floors. +- Stack matching sections for a taller window. Each column swings outwards on its own + with a right-click or redstone. Leave room outside for the pane to swing. +- Rails now meet the posts and corners around windows, and diagonal braces keep their + width where they cross between blocks. Fixed stray rail ends and flickering timber. +- Added a beam above lower walls to close the gap beneath the floorboards. The space + under the overhang stays open. The diagonal brackets now have solid sides and ends. +- Split the kit into Iron Age and Late Medieval & Tudor creative tabs. Pick the eras + you want to craft in the config. Cob, plain daub and thatch are shared by both. +- Start with plain wattle and daub and shape matching post panels into the patterns + you need. Full, thin and short walls use the same recipes. Offcuts can be rejoined, + paired patterns swap one-for-one, and tooltips give you a reminder while you build. +- Expanded limewashing to cover cob stairs and the other raw pieces, one at a time or + in batches of eight. Cob stairs now give eight from six cob, and roof ridges can be + turned back into slopes. + + +0.1.2.110021 - First alpha This is the first building kit for Iron Age Architecture, starting on Minecraft 1.10.2. diff --git a/README.md b/README.md index 95a95fa..2b93490 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,12 @@ floor edges, and matching corner pieces let the overhang continue around the sid ## Getting started -The first alpha targets **Minecraft 1.10.2 with Forge**. Everything is crafted from vanilla +The **0.1.8.110021 alpha** is for **Minecraft 1.10.2 with Forge**. Everything is crafted from vanilla ingredients, and the main content families can be enabled or disabled in the configuration. +See the [CurseForge files](https://www.curseforge.com/minecraft/mc-mods/ironagearchitecture/files/all) +for downloads and the [changelog](CHANGELOG.txt) for what's changed since the first alpha. + Start with plain wattle and daub, surround it with matching planks to make post panels, then arrange those panels into rails, studs, braces and corners. The same patterns work for full walls, thin walls and short pieces. Paired designs swap one-for-one, and offcuts diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 7a204a7..2c3318e 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -22,6 +22,24 @@ The explicit resource generator owns blockstates, models, English language files PNG source art and generation prompts are in art/. Runtime textures are 32x32 nearest-neighbour reductions. Vanilla wood textures remain owned by Minecraft and are referenced by resource location. +## Publishing an alpha + +Push the changes to the fork, then open a PR against MMD's `master-1.10`. After it +merges, wait for the Build and CodeQL checks on that commit. Check the player JAR +from the merged branch's Build run against the SHA-256 of the tested candidate. + +Run **Publish Iron Age Architecture alpha** on MMD's `master-1.10`. Supply the +version from `gradle.properties`, the full merge SHA, the successful Build run ID +and the tested player JAR's SHA-256. The matching section of `CHANGELOG.txt` must +start with ` - Alpha`; it becomes the file's CurseForge changelog. + +Leave **Upload the checked JAR** unticked to verify the inputs and package. Tick +it when the alpha is ready to go out. The workflow needs the `CURSEFORGE_TOKEN` +Actions secret and uploads only the player JAR to CurseForge project 1779832. +Check the file list and previous runs before publishing. If an upload was attempted, +check its file status in CurseForge before trying again; a workflow failure can +happen after CurseForge has accepted the file. + ## Geometry and saved state Each timber wood has five wall-family block IDs: post/cross, sill/head rail, single/close stud, diff --git a/scripts/prepare-alpha.sh b/scripts/prepare-alpha.sh new file mode 100644 index 0000000..38d3c40 --- /dev/null +++ b/scripts/prepare-alpha.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail + +build_dir="$1" +stage_dir="$2" +version="${RELEASE_VERSION:?Set RELEASE_VERSION}" +expected_sha="${PLAYER_SHA256:?Set PLAYER_SHA256}" +jar="iron-age-architecture-$version.jar" + +[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.110021$ && "$expected_sha" =~ ^[0-9a-f]{64}$ ]] +grep -Fxq "mod_version=$version" gradle.properties +grep -Fxq "minecraft_version=1.10.2" gradle.properties +grep -Fxq "mod_archive_name=iron-age-architecture" gradle.properties + +(cd "$build_dir" && sha256sum --strict --check SHA256SUMS.txt) +printf '%s %s\n' "$expected_sha" "$jar" | (cd "$build_dir" && sha256sum --strict --check -) + +mkdir -p "$stage_dir" +awk -v heading="$version - Alpha" ' + /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ - / { if (found) exit; if ($0 == heading) found=1; next } + found { print; if ($0 ~ /^- /) notes=1 } + END { if (!notes) exit 1 } +' CHANGELOG.txt > "$stage_dir/CHANGELOG.md" +cp "$build_dir/$jar" "$stage_dir/$jar" +if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then + printf 'Checked `%s` from build `%s`. SHA-256: `%s`.\n' \ + "$jar" "$BUILD_RUN_ID" "$expected_sha" >> "$GITHUB_STEP_SUMMARY" +fi