From 9f2934dbe2c5a4a6f4503c1d9c9568dd619b82f8 Mon Sep 17 00:00:00 2001 From: edayot Date: Sun, 8 Jan 2023 18:00:19 +0100 Subject: [PATCH 1/3] feat: Added auto-release --- .github/workflows/check-commands.yml | 12 --------- .github/workflows/release.yml | 38 ++++++++++++++++++++++++++++ pyproject.toml | 27 ++++++++++++++++++++ 3 files changed, 65 insertions(+), 12 deletions(-) delete mode 100644 .github/workflows/check-commands.yml create mode 100644 .github/workflows/release.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/check-commands.yml b/.github/workflows/check-commands.yml deleted file mode 100644 index 0b4e6dc8..00000000 --- a/.github/workflows/check-commands.yml +++ /dev/null @@ -1,12 +0,0 @@ -# .github/workflows/check-commands.yml -name: Check commands -on: [push] - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: mcbeet/check-commands@v1 - with: - source: . \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..4f0cbdfa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: CI +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Python 3.11 + uses: actions/setup-python@v2 + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.3.1 + virtualenvs-create: true + virtualenvs-in-project: true + - name: Setup cache for dependencies + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install + - name: Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "github-actions" + git config --global user.email "action@github.com" + poetry run semantic-release publish -v DEBUG -D commit_author="github-actions " \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d523be8e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[tool.poetry] +name = "itemio" +version = "0.0.3" +description = "Item input/output lib - Easy interaction between vanilla and custom containers" +authors = ["edayot "] +license = "MIT" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +smithed-libraries = {git = "https://github.com/edayot/Libraries.git"} +python-semantic-release = "^7.32.2" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.semantic_release] +major_on_zero = false +build_command = "python -m beet -p beet-release.yaml" +dist_path = "build" +upload_to_pypi = false +upload_to_release = true +version_toml = "pyproject.toml:tool.poetry.version" +version_pattern = "beet.yaml:(\\d+\\.\\d+\\.\\d+)" +version_source = "tag" \ No newline at end of file From 43c10c7f4c40a905fb0769ac652adfa8130151f5 Mon Sep 17 00:00:00 2001 From: edayot Date: Sun, 8 Jan 2023 20:00:17 +0100 Subject: [PATCH 2/3] fix: Added yellow_shulker_box.json + git push in action --- .github/workflows/release.yml | 3 +- .../blocks/yellow_shulker_box.json | 91 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 data/minecraft/loot_tables/blocks/yellow_shulker_box.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f0cbdfa..4463fb0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,4 +35,5 @@ jobs: run: | git config --global user.name "github-actions" git config --global user.email "action@github.com" - poetry run semantic-release publish -v DEBUG -D commit_author="github-actions " \ No newline at end of file + poetry run semantic-release publish -v DEBUG -D commit_author="github-actions " + git push \ No newline at end of file diff --git a/data/minecraft/loot_tables/blocks/yellow_shulker_box.json b/data/minecraft/loot_tables/blocks/yellow_shulker_box.json new file mode 100644 index 00000000..39b7a5d3 --- /dev/null +++ b/data/minecraft/loot_tables/blocks/yellow_shulker_box.json @@ -0,0 +1,91 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:dynamic", + "name": "minecraft:contents", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:air" + ], + "nbt": "{drop_contents:1b}" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:yellow_shulker_box", + "functions": [ + { + "function": "minecraft:copy_name", + "source": "block_entity" + }, + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Lock", + "target": "BlockEntityTag.Lock", + "op": "replace" + }, + { + "source": "LootTable", + "target": "BlockEntityTag.LootTable", + "op": "replace" + }, + { + "source": "LootTableSeed", + "target": "BlockEntityTag.LootTableSeed", + "op": "replace" + } + ] + }, + { + "function": "minecraft:set_contents", + "type": "minecraft:shulker_box", + "entries": [ + { + "type": "minecraft:dynamic", + "name": "minecraft:contents" + } + ] + } + ] + } + ] + } + ] + } + ], + "__smithed__": { + "rules": [ + { + "type": "smithed:append", + "target": "pools[0].entries", + "source": { + "type": "smithed:reference", + "path": "pools[0].entries[1]" + } + }, + { + "type": "smithed:append", + "target": "pools[0].entries[0].conditions", + "source": { + "type": "smithed:reference", + "path": "pools[0].entries[0].conditions[0]" + } + } + ] + } +} From 15a76e62d17e7a0808b54f86815234e46732d713 Mon Sep 17 00:00:00 2001 From: edayot Date: Sun, 8 Jan 2023 20:05:06 +0100 Subject: [PATCH 3/3] chore: add files to push --- .github/workflows/release.yml | 3 +++ CHANGELOG.md | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4463fb0c..c6d70fd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,4 +36,7 @@ jobs: git config --global user.name "github-actions" git config --global user.email "action@github.com" poetry run semantic-release publish -v DEBUG -D commit_author="github-actions " + git add beet.yaml + git add pyproject.toml + git add CHANGELOG.md git push \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..dcee4eac --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ + +