mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
Release v1.1.1: headless README flags + DockerHub notes auto from template
This commit is contained in:
parent
99005c19f8
commit
fd2530cea3
5 changed files with 33 additions and 8 deletions
21
.github/workflows/dockerhub-publish.yml
vendored
21
.github/workflows/dockerhub-publish.yml
vendored
|
@ -16,6 +16,23 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Prepare release notes from template
|
||||||
|
id: notes
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
VERSION_REF="${GITHUB_REF##*/}" # e.g. v1.2.3
|
||||||
|
TEMPLATE="RELEASE_NOTES_TEMPLATE.md"
|
||||||
|
if [ -f "$TEMPLATE" ]; then
|
||||||
|
sed "s/\${VERSION}/${VERSION_REF}/g" "$TEMPLATE" > RELEASE_NOTES.md
|
||||||
|
else
|
||||||
|
echo "# MTG Python Deckbuilder ${VERSION_REF}" > RELEASE_NOTES.md
|
||||||
|
echo >> RELEASE_NOTES.md
|
||||||
|
echo "Automated release." >> RELEASE_NOTES.md
|
||||||
|
fi
|
||||||
|
# Escape newlines for label usage
|
||||||
|
DESC=$(awk 'BEGIN{ORS="\\n"} {print}' RELEASE_NOTES.md)
|
||||||
|
echo "desc=$DESC" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
@ -38,6 +55,10 @@ jobs:
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=MTG Python Deckbuilder
|
||||||
|
org.opencontainers.image.version=${{ github.ref_name }}
|
||||||
|
org.opencontainers.image.description=${{ steps.notes.outputs.desc }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
|
|
BIN
README.md
BIN
README.md
Binary file not shown.
|
@ -1,5 +1,7 @@
|
||||||
# MTG Python Deckbuilder v1.1.0 Release Notes
|
# MTG Python Deckbuilder v1.1.0 Release Notes
|
||||||
|
|
||||||
|
Note: Future releases will generate this file from `RELEASE_NOTES_TEMPLATE.md` automatically in CI.
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
- Headless mode via submenu in the main menu (auto-runs single config; lists multiple as "Commander - Theme1, Theme2, Theme3"; `deck.json` shows as "Default")
|
- Headless mode via submenu in the main menu (auto-runs single config; lists multiple as "Commander - Theme1, Theme2, Theme3"; `deck.json` shows as "Default")
|
||||||
- Config precedence: CLI > env > JSON > defaults; honors `ideal_counts` in JSON
|
- Config precedence: CLI > env > JSON > defaults; honors `ideal_counts` in JSON
|
||||||
|
|
|
@ -6,7 +6,7 @@ import os
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from code.deck_builder.builder import DeckBuilder
|
from deck_builder.builder import DeckBuilder
|
||||||
|
|
||||||
"""Headless (non-interactive) runner.
|
"""Headless (non-interactive) runner.
|
||||||
|
|
||||||
|
@ -159,10 +159,12 @@ def run(
|
||||||
if csv_path:
|
if csv_path:
|
||||||
base = os.path.splitext(os.path.basename(csv_path))[0]
|
base = os.path.splitext(os.path.basename(csv_path))[0]
|
||||||
builder.export_decklist_text(filename=base + '.txt')
|
builder.export_decklist_text(filename=base + '.txt')
|
||||||
if hasattr(builder, 'export_run_config_json'):
|
# Headless policy: do NOT export JSON by default. Opt-in with HEADLESS_EXPORT_JSON=1
|
||||||
|
allow_json = (os.getenv('HEADLESS_EXPORT_JSON', '').strip().lower() in {'1','true','yes','on'})
|
||||||
|
if allow_json and hasattr(builder, 'export_run_config_json'):
|
||||||
try:
|
try:
|
||||||
cfg_path_env = os.getenv('DECK_CONFIG')
|
cfg_path_env = os.getenv('DECK_CONFIG')
|
||||||
if cfg_path_env:
|
if cfg_path_env and os.path.isdir(os.path.dirname(cfg_path_env) or '.'):
|
||||||
cfg_dir = os.path.dirname(cfg_path_env) or '.'
|
cfg_dir = os.path.dirname(cfg_path_env) or '.'
|
||||||
elif os.path.isdir('/app/config'):
|
elif os.path.isdir('/app/config'):
|
||||||
cfg_dir = '/app/config'
|
cfg_dir = '/app/config'
|
||||||
|
@ -170,8 +172,8 @@ def run(
|
||||||
cfg_dir = 'config'
|
cfg_dir = 'config'
|
||||||
os.makedirs(cfg_dir, exist_ok=True)
|
os.makedirs(cfg_dir, exist_ok=True)
|
||||||
builder.export_run_config_json(directory=cfg_dir, filename=base + '.json')
|
builder.export_run_config_json(directory=cfg_dir, filename=base + '.json')
|
||||||
# If an explicit DECK_CONFIG path is given, also write to exactly that path
|
# If an explicit DECK_CONFIG path is given to a file, write exactly there as well
|
||||||
if cfg_path_env:
|
if cfg_path_env and os.path.splitext(cfg_path_env)[1].lower() == '.json':
|
||||||
cfg_dir2 = os.path.dirname(cfg_path_env) or '.'
|
cfg_dir2 = os.path.dirname(cfg_path_env) or '.'
|
||||||
cfg_name2 = os.path.basename(cfg_path_env)
|
cfg_name2 = os.path.basename(cfg_path_env)
|
||||||
os.makedirs(cfg_dir2, exist_ok=True)
|
os.makedirs(cfg_dir2, exist_ok=True)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"commander": "Aang, Airbending Master",
|
"commander": "Aang, Airbending Master",
|
||||||
"primary_tag": "Experience Counters",
|
"primary_tag": "Exile Matters",
|
||||||
"secondary_tag": "Token Creation",
|
"secondary_tag": "Airbending",
|
||||||
"tertiary_tag": null,
|
"tertiary_tag": "Token Creation",
|
||||||
"bracket_level": 4,
|
"bracket_level": 4,
|
||||||
"use_multi_theme": true,
|
"use_multi_theme": true,
|
||||||
"add_lands": true,
|
"add_lands": true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue