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
46 changes: 17 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ on:
branches: [main]
paths:
- "smithed/**"
- "requirements.lock"
- "requirements-dev.lock"
- "uv.lock"

push:
branches: [main]
paths:
- "smithed/**"
- "pyproject.toml"
- "requirements.lock"
- "requirements-dev.lock"
- "uv.lock"
- ".github/workflows/main.yml"
- "Dockerfile"

Expand All @@ -26,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.13"]

steps:
# ---------------------------------------------
Expand All @@ -39,41 +37,32 @@ jobs:
# ---------------------------------------------
# ----- setup and install python -----
# ---------------------------------------------
- name: Install the latest version of rye
uses: eifinger/setup-rye@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
enable-cache: true
cache-prefix: "python-rye"
python-version: ${{ matrix.python-version }}

- name: Enable uv in rye for speeeeed
run: rye config --set-bool behavior.use-uv=true
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

#----------------------------------------------
# ----- install & configure rye -----
# ----- install dependencies -----
#----------------------------------------------

- name: Cache venv
id: cache-venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.lock') }}-${{ hashFiles('requirements-dev.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.python-version }}-

- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: rye sync
run: uv sync --frozen --all-extras

#----------------------------------------------
# ----- pass linting & tests -----
#----------------------------------------------

- name: Run linting and style checking
run: rye format --check
run: uv run ruff format --check

- name: Run unit tests
run: rye test -v
run: uv run pytest -v

# ---------------------------------------------
# ----- Release Package -----
Expand All @@ -90,12 +79,11 @@ jobs:
TWINE_NON_INTERACTIVE: true
continue-on-error: true
run: |
. .venv/bin/activate
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
semantic-release version
twine upload dist/*
semantic-release publish
uv run semantic-release version
uv run twine upload dist/*
uv run semantic-release publish

# ---------------------------------------------
# ----- Push to prod -----
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:first

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
3 changes: 3 additions & 0 deletions examples/basic/first/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "first"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:second

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
3 changes: 3 additions & 0 deletions examples/basic/second/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "second"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:first

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:first

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:first_overlay

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
17 changes: 17 additions & 0 deletions examples/basic_overlays/first/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "first",
"pack": {
"pack_format": 60
},
"overlays": {
"entries": [
{
"formats": [
61,
61
],
"directory": "overlay"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:second

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:second

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:second_overlay

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
14 changes: 14 additions & 0 deletions examples/basic_overlays/second/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "second",
"overlays": {
"entries": [
{
"formats": [
61,
61
],
"directory": "overlay"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:data

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:overlay_48_61

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:overlay_51_64

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: minecraft:entity

pools:
- rolls: 1
bonus_rolls: 0
entries:
- type: minecraft:item
name: minecraft:overlay_62_inf

__smithed__:
rules:
- type: smithed:append
target: pools
source:
type: smithed:reference
path: pools[0]
28 changes: 28 additions & 0 deletions examples/complex_overlays/pack1/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "pack1",
"overlays": {
"entries": [
{
"formats": [
48,
61
],
"directory": "overlay_48_61"
},
{
"formats": [
51,
64
],
"directory": "overlay_51_64"
},
{
"formats": [
62,
2147483647
],
"directory": "overlay_62_inf"
}
]
}
}
Loading
Loading