From 82ac888e74f26887524aa8aa98aac53a0f8b2687 Mon Sep 17 00:00:00 2001 From: Mike Ammerlaan Date: Mon, 29 Jun 2026 08:39:25 -0700 Subject: [PATCH] fix: Update create-release workflow for versions - Also add multi block sample updates --- .github/workflows/create-release.yml | 77 +++++++++++------- .../behavior_pack/blocks/horizontal_log.json | 74 +++++++++++++++++ .../items/horizontal_log_item.json | 27 ++++++ multi-block_sample/resource_pack/blocks.json | 3 + .../resource_pack/textures/item_texture.json | 5 +- .../textures/items/horizontal_log.png | Bin 0 -> 691 bytes .../textures/terrain_texture.json | 6 ++ 7 files changed, 161 insertions(+), 31 deletions(-) create mode 100644 multi-block_sample/behavior_pack/blocks/horizontal_log.json create mode 100644 multi-block_sample/behavior_pack/items/horizontal_log_item.json create mode 100644 multi-block_sample/resource_pack/textures/items/horizontal_log.png diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index faf2955..ad472ee 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -2,6 +2,15 @@ name: Create Release on: workflow_dispatch: + inputs: + bump: + description: "Version part to increment for this release" + type: choice + default: patch + options: + - patch + - minor + - major jobs: build-and-publish: @@ -23,17 +32,40 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Bump version + - name: Determine next version id: version - uses: vemel/nextversion@0.1.1 - with: - path: ./addon_starter/complete/package.json - type: semver - result: ${{ github.event.inputs.bump }} - release: ${{ github.event.inputs.release }} - update: | - ./addon_starter/complete/package.json - ./addon_starter/complete/README.md + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + BUMP="${{ github.event.inputs.bump }}" + BUMP="${BUMP:-patch}" + + # Highest MAJOR.MINOR.PATCH across all existing releases, including + # drafts and prereleases (which the /releases/latest endpoint skips). + LATEST=$(gh api --paginate "repos/${{ github.repository }}/releases" \ + --jq '.[].tag_name' \ + | sed -E 's/^v//; s/-.*$//' \ + | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \ + | sort -t. -k1,1n -k2,2n -k3,3n \ + | tail -n1 || true) + + if [ -z "$LATEST" ]; then + # No releases yet: bootstrap from package.json, used as-is. + NEXT=$(node -p "require('./addon_starter/complete/package.json').version") + echo "No prior releases found; bootstrapping to $NEXT" + else + IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST" + case "$BUMP" in + major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;; + minor) MINOR=$((MINOR + 1)); PATCH=0 ;; + *) PATCH=$((PATCH + 1)) ;; + esac + NEXT="$MAJOR.$MINOR.$PATCH" + echo "Latest released version $LATEST -> next $NEXT ($BUMP)" + fi + + echo "version=$NEXT" >> "$GITHUB_OUTPUT" - name: Build env: @@ -56,19 +88,13 @@ jobs: npm run mcaddon popd - - name: Get Package Version - id: get-package-version - with: - path: addon_starter/complete/ - uses: stevenbenitez/get-package-version-action@v1 - - name: Create draft Minecraft Samples release id: create_samples_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.get-package-version.outputs.version }}-alpha + tag_name: v${{ steps.version.outputs.version }}-alpha release_name: Minecraft Samples draft: true prerelease: true @@ -81,7 +107,7 @@ jobs: with: upload_url: ${{ steps.create_samples_release.outputs.upload_url }} asset_path: ./addon_starter/complete/dist/packages/aop_mobs.mcaddon - asset_name: addon_starter_complete_v${{ steps.get-package-version.outputs.version }}.mcaddon + asset_name: addon_starter_complete_v${{ steps.version.outputs.version }}.mcaddon asset_content_type: application/zip - name: Upload chill_dreams_complete_v.mcaddon to node_module release @@ -92,7 +118,7 @@ jobs: with: upload_url: ${{ steps.create_samples_release.outputs.upload_url }} asset_path: ./casual_creator/chill_dreams/complete/dist/packages/mamm_cds.mcaddon - asset_name: chill_dreams_complete_v${{ steps.get-package-version.outputs.version }}.mcaddon + asset_name: chill_dreams_complete_v${{ steps.version.outputs.version }}.mcaddon asset_content_type: application/zip - name: Upload gray_wave_v.mcaddon to node_module release @@ -103,7 +129,7 @@ jobs: with: upload_url: ${{ steps.create_samples_release.outputs.upload_url }} asset_path: ./casual_creator/gray_wave/dist/packages/mikeamm_gwve.mcaddon - asset_name: gray_wave_v${{ steps.get-package-version.outputs.version }}.mcaddon + asset_name: gray_wave_v${{ steps.version.outputs.version }}.mcaddon asset_content_type: application/zip - name: Upload toss_lab_v.mcaddon to node_module release @@ -114,14 +140,5 @@ jobs: with: upload_url: ${{ steps.create_samples_release.outputs.upload_url }} asset_path: ./toss_lab/dist/packages/toss_lab.mcaddon - asset_name: toss_lab_v${{ steps.get-package-version.outputs.version }}.mcaddon + asset_name: toss_lab_v${{ steps.version.outputs.version }}.mcaddon asset_content_type: application/zip - - - name: Commit version changes - run: | - VERSION=${{ toJSON(steps.version.outputs.result) }} - BRANCH="main" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git commit -am "Bump version to $VERSION" - git push origin $BRANCH diff --git a/multi-block_sample/behavior_pack/blocks/horizontal_log.json b/multi-block_sample/behavior_pack/blocks/horizontal_log.json new file mode 100644 index 0000000..fae4836 --- /dev/null +++ b/multi-block_sample/behavior_pack/blocks/horizontal_log.json @@ -0,0 +1,74 @@ +{ + "format_version": "1.26.40", + "minecraft:block": { + "description": { + "identifier": "multi_block:horizontal_log", + "traits": { + "minecraft:placement_direction": { + "enabled_states": [ + "minecraft:cardinal_direction" + ] + }, + "minecraft:multi_block": { + "enabled_states": ["minecraft:multi_block_part"], + "parts": 4, + "direction": "north" + } + } + }, + + "components": { + "minecraft:geometry": "minecraft:geometry.full_block", + "minecraft:material_instances": { + "up": {"texture": "horizontal_log_side"}, + "down": {"texture": "horizontal_log_side"}, + "north": {"texture": "horizontal_log_top"}, + "south": {"texture": "horizontal_log_top"}, + "west": {"texture": "horizontal_log_side"}, + "east": {"texture": "horizontal_log_side"} + }, + "minecraft:collision_box": true, + "minecraft:movable": {"movement_type": "immovable"}, + "minecraft:destructible_by_mining": { + "seconds_to_destroy": 3 + }, + "minecraft:destructible_by_explosion": { + "explosion_resistance": 3 + } + }, + "permutations": [ + { + "condition": "q.block_state('minecraft:cardinal_direction') == 'north'", + "components": { + "minecraft:transformation": { + "rotation": [0,0,0] + } + } + }, + { + "condition": "q.block_state('minecraft:cardinal_direction') == 'south'", + "components": { + "minecraft:transformation": { + "rotation": [0,180,0] + } + } + }, + { + "condition": "q.block_state('minecraft:cardinal_direction') == 'west'", + "components": { + "minecraft:transformation": { + "rotation": [0,90,0] + } + } + }, + { + "condition": "q.block_state('minecraft:cardinal_direction') == 'east'", + "components": { + "minecraft:transformation": { + "rotation": [0,270,0] + } + } + } + ] + } +} \ No newline at end of file diff --git a/multi-block_sample/behavior_pack/items/horizontal_log_item.json b/multi-block_sample/behavior_pack/items/horizontal_log_item.json new file mode 100644 index 0000000..5ef6daa --- /dev/null +++ b/multi-block_sample/behavior_pack/items/horizontal_log_item.json @@ -0,0 +1,27 @@ +{ + "format_version": "1.21.100", + "minecraft:item": { + "description": { + "identifier": "multi_block:horizontal_log" + }, + + "components": { + "minecraft:icon": { + "textures": { + "default": "horizontal_log_item" + } + }, + "minecraft:block_placer": { + "block": "multi_block:horizontal_log", + "replace_block_item": true + }, + "minecraft:display_name": { + "value": "horizontal log" + }, + "minecraft:tags": { + "tags": [ "minecraft:logs_that_burn" ] + }, + "minecraft:max_stack_size": 64 + } + } +} diff --git a/multi-block_sample/resource_pack/blocks.json b/multi-block_sample/resource_pack/blocks.json index dcf4ca0..8c9943c 100644 --- a/multi-block_sample/resource_pack/blocks.json +++ b/multi-block_sample/resource_pack/blocks.json @@ -6,5 +6,8 @@ ], "multiblock:light": { "sound": "metal" + }, + "multi_block:horizontal_log": { + "sound": "wood" } } \ No newline at end of file diff --git a/multi-block_sample/resource_pack/textures/item_texture.json b/multi-block_sample/resource_pack/textures/item_texture.json index bea4b34..7aa8687 100644 --- a/multi-block_sample/resource_pack/textures/item_texture.json +++ b/multi-block_sample/resource_pack/textures/item_texture.json @@ -4,6 +4,9 @@ "texture_data": { "light_post_item": { "textures": "textures/items/light_post_item" - } + }, + "horizontal_log_item": { + "textures": "textures/items/horizontal_log" + } } } \ No newline at end of file diff --git a/multi-block_sample/resource_pack/textures/items/horizontal_log.png b/multi-block_sample/resource_pack/textures/items/horizontal_log.png new file mode 100644 index 0000000000000000000000000000000000000000..3c8549a97a43400e09002f1dd5a57ed34029cc7e GIT binary patch literal 691 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaMM3p^r=85sBufiR<}hF1enL3?IML`j6Nk5zJhu3lnFep0GlMQ#C5H3Nf< zeMLcHa&~HoLQ-maW}dD3``!E16*5z7)x%AF4SWlnQ!_F>s)|yBtNcQetFn_VQ`GJ4 zc)4sUtbiuurj{fsROII56ON0GHI_ zN%^HEwo0X?nJHFjiD{-uDJiD9Nr}cOx`u`+iMoj?#)i5n#>Oe;riK zGN53Bhi+;fFi6XRVW%@?1~)L=w|crbhFJLTowSj+*+9Tm-mi5Eqr~CjnE7pi8J7$> zjdz?C;wh4j>3TB3(QJap$=5pfzyFU<|6#r=ODU<2@Ad22kgGvn3_OPu7|xchXxn{E zf>Gl5M#ddE&$?Eu+M4UlvHpPGvop-AvTE;(AC(C$_-IzP;CKpR% zLw!~@tbP0l+XkK