Skip to content

Polish jump and run visuals #34

Polish jump and run visuals

Polish jump and run visuals #34

Workflow file for this run

name: MiniPixels CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
permissions:
contents: write
jobs:
windows:
name: Windows tests and examples
runs-on: windows-latest
steps:
- name: Checkout MiniPixels
uses: actions/checkout@v5
with:
path: MiniPixels
- name: Checkout MiniLangCompilerPy
uses: actions/checkout@v5
with:
repository: MiniLangProject/MiniLangCompilerPy
path: MiniLangCompilerPy
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run MiniPixels tests
working-directory: MiniPixels
run: python tests\run_tests.py
- name: Build examples
working-directory: MiniPixels
run: python tools\build_examples.py
- name: Build native MiniLang CLI
shell: pwsh
working-directory: MiniPixels
run: |
New-Item -ItemType Directory -Force build\tools | Out-Null
python ..\MiniLangCompilerPy\mlc_win64.py tools\minipixels_cli.ml build\tools\minipixels.exe -I src -I ..\MiniLangCompilerPy
.\build\tools\minipixels.exe info
.\build\tools\minipixels.exe doctor
.\build\tools\minipixels.exe validate examples\moving-sprite\minipixels.json
.\build\tools\minipixels.exe validate examples\scrolling-world\minipixels.json
.\build\tools\minipixels.exe validate examples\pixel-effects\minipixels.json
.\build\tools\minipixels.exe validate examples\jump-and-run\minipixels.json
.\build\tools\minipixels.exe validate examples\tiled-platformer\minipixels.json
.\build\tools\minipixels.exe generate examples\pixel-effects\minipixels.json build\native-generated\pixel-effects
.\build\tools\minipixels.exe generate examples\jump-and-run\minipixels.json build\native-generated\jump-and-run\generated
- name: Smoke native MiniLang CLI templates
shell: pwsh
working-directory: MiniPixels
run: |
$tmp = Join-Path $env:TEMP "minipixels-native-cli-smoke"
if (Test-Path $tmp) { Remove-Item -LiteralPath $tmp -Recurse -Force }
New-Item -ItemType Directory -Force $tmp | Out-Null
Copy-Item build\tools\minipixels.exe $tmp\minipixels.exe
Push-Location $tmp
try {
foreach ($tpl in @("basic", "platformer", "pixel-art")) {
$name = "demo-$tpl"
.\minipixels.exe new $name $tpl
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\minipixels.exe validate "$name\minipixels.json"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\minipixels.exe generate "$name\minipixels.json"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python "$env:GITHUB_WORKSPACE\MiniLangCompilerPy\mlc_win64.py" "$tmp\$name\src\main.ml" "$tmp\$name\$name.exe" -I "$env:GITHUB_WORKSPACE\MiniPixels\src" -I "$env:GITHUB_WORKSPACE\MiniLangCompilerPy"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
} finally {
Pop-Location
}
- name: Package SDK
working-directory: MiniPixels
run: python tools\package_sdk.py
- name: Upload SDK artifact
uses: actions/upload-artifact@v6
with:
name: minipixels-sdk
path: |
MiniPixels/dist/*-sdk.zip
MiniPixels/dist/*.sha256
compression-level: 0
- name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v')
shell: pwsh
working-directory: MiniPixels
env:
GH_TOKEN: ${{ github.token }}
run: |
$tag = "${{ github.ref_name }}"
$assets = @("dist/*-sdk.zip", "dist/*.sha256")
gh release view $tag *> $null
if ($LASTEXITCODE -eq 0) {
gh release upload $tag @assets --clobber
} else {
gh release create $tag @assets --title "MiniPixels $tag" --generate-notes
}