Skip to content

Commit 055a764

Browse files
dwursteisenclaude
andcommitted
add export bundle testing to GitHub Actions CI
- Fix classpath separator in ExportCommand to use File.pathSeparator instead of hardcoded ":" so desktop export works on Windows - Upload CLI distribution as artifact from build job - Add test-export matrix job (ubuntu, windows, macos) that verifies both web and desktop export commands produce expected outputs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 217eaf1 commit 055a764

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,60 @@ jobs:
4848
with:
4949
github_token: ${{ secrets.GITHUB_TOKEN }}
5050
publish_dir: ./tiny-doc/build/docs/asciidoc
51+
- name: Upload CLI distribution
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: tiny-cli-dist
55+
path: tiny-cli/build/distributions/tiny-cli-${{github.ref_name}}.zip
56+
retention-days: 1
57+
58+
test-export:
59+
needs: build
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
matrix:
63+
os: [ubuntu-latest, windows-latest, macos-latest]
64+
65+
steps:
66+
- name: Checkout the repo
67+
uses: actions/checkout@v3
68+
- name: Set up JDK 17
69+
uses: actions/setup-java@v3
70+
with:
71+
java-version: 17
72+
distribution: 'zulu'
73+
- name: Download CLI distribution
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: tiny-cli-dist
77+
- name: Extract CLI distribution (Unix)
78+
if: runner.os != 'Windows'
79+
run: unzip tiny-cli-${{github.ref_name}}.zip
80+
- name: Extract CLI distribution (Windows)
81+
if: runner.os == 'Windows'
82+
run: Expand-Archive -Path tiny-cli-${{github.ref_name}}.zip -DestinationPath .
83+
- name: Test web export (Unix)
84+
if: runner.os != 'Windows'
85+
run: |
86+
tiny-cli-${{github.ref_name}}/bin/tiny-cli export tiny-sample
87+
test -f tiny-sample/tiny-export.zip
88+
- name: Test web export (Windows)
89+
if: runner.os == 'Windows'
90+
run: |
91+
tiny-cli-${{github.ref_name}}\bin\tiny-cli.bat export tiny-sample
92+
if (-Not (Test-Path tiny-sample\tiny-export.zip)) { exit 1 }
93+
- name: Test desktop export (Unix)
94+
if: runner.os != 'Windows'
95+
run: |
96+
tiny-cli-${{github.ref_name}}/bin/tiny-cli export tiny-sample -p desktop --exclude-jdk
97+
test -d exported-game
98+
ls exported-game/*.jar
99+
- name: Test desktop export (Windows)
100+
if: runner.os == 'Windows'
101+
run: |
102+
tiny-cli-${{github.ref_name}}\bin\tiny-cli.bat export tiny-sample -p desktop --exclude-jdk
103+
if (-Not (Test-Path exported-game)) { exit 1 }
104+
if (-Not (Get-ChildItem exported-game\*.jar)) { exit 1 }
51105
52106
env:
53107
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

tiny-cli/src/main/kotlin/com/github/minigdx/tiny/cli/command/ExportCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class ExportCommand : CliktCommand(name = "export") {
422422

423423
private fun getDependencies(): List<String> {
424424
val classPath = System.getProperty("java.class.path")
425-
return classPath.split(":")
425+
return classPath.split(File.pathSeparator)
426426
.filter { it.endsWith(".jar") }
427427
.filter { !it.contains("tiny-cli-") } // Exclude the CLI jar as it's already copied
428428
.distinct()

0 commit comments

Comments
 (0)