Skip to content
Open
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
77 changes: 47 additions & 30 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
74 changes: 74 additions & 0 deletions multi-block_sample/behavior_pack/blocks/horizontal_log.json
Original file line number Diff line number Diff line change
@@ -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]
}
}
}
]
}
}
27 changes: 27 additions & 0 deletions multi-block_sample/behavior_pack/items/horizontal_log_item.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
3 changes: 3 additions & 0 deletions multi-block_sample/resource_pack/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
],
"multiblock:light": {
"sound": "metal"
},
"multi_block:horizontal_log": {
"sound": "wood"
}
}
5 changes: 4 additions & 1 deletion multi-block_sample/resource_pack/textures/item_texture.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"texture_data": {
"light_post_item": {
"textures": "textures/items/light_post_item"
}
},
"horizontal_log_item": {
"textures": "textures/items/horizontal_log"
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
},
"light_post_off": {
"textures": "textures/blocks/light_post_off"
},
"horizontal_log_top": {
"textures": "textures/blocks/log_birch_top"
},
"horizontal_log_side": {
"textures": "textures/blocks/log_birch"
}
}
}