chore(release): v2.2.7

This commit is contained in:
matt 2025-09-10 08:01:51 -07:00
parent 6fe8a7af89
commit 45658d0b72
6 changed files with 247 additions and 87 deletions

View file

@ -7,11 +7,16 @@ on:
workflow_dispatch:
jobs:
docker:
prepare:
name: Prepare metadata
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
version: ${{ steps.notes.outputs.version }}
desc: ${{ steps.notes.outputs.desc }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
@ -29,43 +34,10 @@ jobs:
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
echo "version=$VERSION_REF" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Smoke test image boots Web UI by default (amd64)
shell: bash
run: |
# Build a local test image (amd64) and load into docker
docker buildx build --platform linux/amd64 --load -t mtg-deckbuilder:test --build-arg APP_VERSION=${{ steps.notes.outputs.version }} .
# Run container and wait for it to serve on 8080
docker rm -f mtg-smoke 2>/dev/null || true
docker run -d --name mtg-smoke -p 8080:8080 mtg-deckbuilder:test
echo "Waiting for Web UI..."
for i in {1..30}; do
if curl -fsS http://localhost:8080/ >/dev/null; then echo "Up"; break; fi
sleep 2
done
# Final assert; print logs on failure
if ! curl -fsS http://localhost:8080/ >/dev/null; then
echo "Web UI did not start in time. Container logs:" && docker logs mtg-smoke || true
exit 1
fi
docker rm -f mtg-smoke >/dev/null 2>&1 || true
- name: Docker Hub login
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.8.0
@ -81,15 +53,196 @@ jobs:
org.opencontainers.image.description=${{ steps.notes.outputs.desc }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and push
build_amd64:
name: Build (amd64)
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: read
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
- name: Prepare amd64 tag list
id: arch_tags
shell: bash
run: |
echo "Generating amd64 tag variants" >&2
TAGS='${{ needs.prepare.outputs.tags }}'
echo "$TAGS" | sed 's/$/-amd64/' | grep . > tags.txt
echo "Computed tags:" >&2; cat tags.txt >&2
echo "tags<<EOF" >> $GITHUB_OUTPUT
cat tags.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Docker Hub login
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Smoke test Web UI (local build)
shell: bash
env:
APP_VERSION: ${{ needs.prepare.outputs.version }}
run: |
docker buildx build --platform linux/amd64 --load -t mtg-deckbuilder:test --build-arg APP_VERSION=$APP_VERSION .
docker rm -f mtg-smoke 2>/dev/null || true
docker run -d --name mtg-smoke -p 8080:8080 mtg-deckbuilder:test
echo "Waiting for Web UI (amd64)..."
for i in {1..30}; do
if curl -fsS http://localhost:8080/ >/dev/null; then echo "Up"; break; fi
sleep 2
done
if ! curl -fsS http://localhost:8080/ >/dev/null; then
echo "Web UI did not start in time. Logs:" && docker logs mtg-smoke || true
exit 1
fi
docker rm -f mtg-smoke >/dev/null 2>&1 || true
- name: Build & push arch image (amd64)
id: build
uses: docker/build-push-action@v6.18.0
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
tags: ${{ steps.arch_tags.outputs.tags }}
labels: ${{ needs.prepare.outputs.labels }}
build-args: |
APP_VERSION=${{ steps.notes.outputs.version }}
APP_VERSION=${{ needs.prepare.outputs.version }}
build_arm64_native:
name: Build (arm64 native)
# Native ARM64 GitHub hosted runner; if unavailable replace with self-hosted label
runs-on: ubuntu-24.04-arm64
needs: prepare
permissions:
contents: read
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
- name: Prepare arm64 tag list
id: arch_tags
shell: bash
run: |
echo "Generating arm64 tag variants (native)" >&2
TAGS='${{ needs.prepare.outputs.tags }}'
echo "$TAGS" | sed 's/$/-arm64/' | grep . > tags.txt
echo "Computed tags:" >&2; cat tags.txt >&2
echo "tags<<EOF" >> $GITHUB_OUTPUT
cat tags.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Docker Hub login
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Build & push arch image (arm64 native)
id: build
uses: docker/build-push-action@v6.18.0
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64
tags: ${{ steps.arch_tags.outputs.tags }}
labels: ${{ needs.prepare.outputs.labels }}
build-args: |
APP_VERSION=${{ needs.prepare.outputs.version }}
build_arm64_emulated:
name: Build (arm64 emulated fallback)
runs-on: ubuntu-latest
needs: [prepare, build_arm64_native]
if: needs.build_arm64_native.result == 'failure'
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
- name: Prepare arm64 tag list (fallback)
id: arch_tags
shell: bash
run: |
echo "Generating arm64 tag variants (fallback)" >&2
TAGS='${{ needs.prepare.outputs.tags }}'
echo "$TAGS" | sed 's/$/-arm64/' | grep . > tags.txt
echo "tags<<EOF" >> $GITHUB_OUTPUT
cat tags.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Docker Hub login
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU (for emulation)
uses: docker/setup-qemu-action@v3.6.0
- name: Set up Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Build & push arch image (arm64 emulated)
uses: docker/build-push-action@v6.18.0
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64
tags: ${{ steps.arch_tags.outputs.tags }}
labels: ${{ needs.prepare.outputs.labels }}
build-args: |
APP_VERSION=${{ needs.prepare.outputs.version }}
manifest:
name: Create multi-arch manifests
runs-on: ubuntu-latest
needs: [prepare, build_amd64, build_arm64_native, build_arm64_emulated]
steps:
- name: Docker Hub login
uses: docker/login-action@v3.5.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create & push manifests
shell: bash
env:
TAGS: ${{ needs.prepare.outputs.tags }}
run: |
echo "Creating multi-arch manifests (native preferred, fallback if needed)..."
echo "$TAGS" | while read -r tag; do
[ -z "$tag" ] && continue
echo "Processing $tag"
SOURCES="${tag}-amd64"
if docker buildx imagetools inspect "${tag}-arm64" >/dev/null 2>&1; then
echo "Found arm64 image tag: ${tag}-arm64"
SOURCES="$SOURCES ${tag}-arm64"
else
echo "No arm64 image found for $tag (skipping arm64 in manifest)" >&2
fi
docker buildx imagetools create -t "$tag" $SOURCES
done
echo "Done."
- name: Inspect primary tag
run: |
FIRST=$(echo "$TAGS" | head -n1)
docker buildx imagetools inspect "$FIRST"

View file

@ -7,45 +7,49 @@ on:
workflow_dispatch:
jobs:
build-windows:
name: Build Windows EXE
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
- name: Setup Python
uses: actions/setup-python@v5.6.0
with:
python-version: '3.11'
- name: Install dependencies
shell: powershell
run: |
python -m pip install --upgrade pip wheel setuptools
if (Test-Path 'requirements.txt') { pip install -r requirements.txt }
pip install pyinstaller
- name: Build executable (PyInstaller)
shell: powershell
run: |
# Build using spec for reliable packaging
pyinstaller mtg_deckbuilder.spec
if (!(Test-Path dist/mtg-deckbuilder.exe)) {
Write-Host 'Spec build failed; retrying simple build with --paths code'
pyinstaller --onefile --name mtg-deckbuilder --paths code code/main.py
}
if (!(Test-Path dist/mtg-deckbuilder.exe)) { throw 'Build failed: dist/mtg-deckbuilder.exe not found' }
- name: Upload artifact (Windows EXE)
uses: actions/upload-artifact@v4.6.2
with:
name: mtg-deckbuilder-windows
path: dist/mtg-deckbuilder.exe
# Windows executable build temporarily disabled. To re-enable:
# 1. Uncomment the 'build-windows' job below.
# 2. Add 'needs: build-windows' back to the 'release' job.
# 3. Re-add the artifact download & file attachment steps.
# Reason: Current releases do not ship a Windows EXE; focusing on container / source distribution.
#
# build-windows:
# name: Build Windows EXE
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v5.0.0
#
# - name: Setup Python
# uses: actions/setup-python@v5.6.0
# with:
# python-version: '3.11'
#
# - name: Install dependencies
# shell: powershell
# run: |
# python -m pip install --upgrade pip wheel setuptools
# if (Test-Path 'requirements.txt') { pip install -r requirements.txt }
# pip install pyinstaller
#
# - name: Build executable (PyInstaller)
# shell: powershell
# run: |
# pyinstaller mtg_deckbuilder.spec
# if (!(Test-Path dist/mtg-deckbuilder.exe)) {
# Write-Host 'Spec build failed; retrying simple build with --paths code'
# pyinstaller --onefile --name mtg-deckbuilder --paths code code/main.py
# }
# if (!(Test-Path dist/mtg-deckbuilder.exe)) { throw 'Build failed: dist/mtg-deckbuilder.exe not found' }
#
# - name: Upload artifact (Windows EXE)
# uses: actions/upload-artifact@v4.6.2
# with:
# name: mtg-deckbuilder-windows
# path: dist/mtg-deckbuilder.exe
release:
runs-on: ubuntu-latest
needs: build-windows
permissions:
contents: write
steps:
@ -69,19 +73,11 @@ jobs:
echo "version=$VERSION_REF" >> $GITHUB_OUTPUT
echo "notes_file=RELEASE_NOTES.md" >> $GITHUB_OUTPUT
- name: Download build artifacts
uses: actions/download-artifact@v5.0.0
with:
name: mtg-deckbuilder-windows
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2.3.2
with:
tag_name: ${{ steps.notes.outputs.version }}
name: ${{ steps.notes.outputs.version }}
body_path: ${{ steps.notes.outputs.notes_file }}
files: |
artifacts/mtg-deckbuilder.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -12,6 +12,17 @@ This format follows Keep a Changelog principles and aims for Semantic Versioning
## [Unreleased]
### Added
- (placeholder)
### Changed
- (placeholder)
### Fixed
- (placeholder)
## [2.2.7] - 2025-09-10
### Added
- Comprehensive structured logging for include/exclude operations with event tracking
- Include/exclude card lists feature with `ALLOW_MUST_HAVES=true` environment variable flag

View file

@ -30,7 +30,7 @@ services:
# Compliance/exports
WEB_AUTO_ENFORCE: "0" # 1=auto-apply bracket enforcement and re-export
APP_VERSION: "v2.2.6" # Optional label shown in footer
APP_VERSION: "v2.2.7" # Optional label shown in footer
# WEB_CUSTOM_EXPORT_BASE: "" # Optional custom export basename
# Paths (optional overrides)

View file

@ -30,7 +30,7 @@ services:
# Compliance/exports
WEB_AUTO_ENFORCE: "0"
APP_VERSION: "v2.2.6"
APP_VERSION: "v2.2.7"
# WEB_CUSTOM_EXPORT_BASE: ""
# Paths (optional overrides)

View file

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "mtg-deckbuilder"
version = "2.2.6"
version = "2.2.7"
description = "A command-line tool for building and analyzing Magic: The Gathering decks"
readme = "README.md"
license = {file = "LICENSE"}