Closed haleksandre closed 4 weeks ago
After thinking about it, I figureda way to make the parsed string remain a string to be then passed on to the tauri build
command.
If anyone has issues passing JSON to the --config
flag in the Github Actions, I was able to make the string parse correctly by first escaping a ' (single quote) & then adding a " (double quote) & finally escaping the " (double quote) within the JSON, like so:
matrix:
include:
# ..other matrice
- platform: windows-latest
target: x86_64-pc-windows-msvc
args: |
--target x86_64-pc-windows-msvc ${{ needs.release.outputs.prerelease && format('--config ''"{{ \"version\": \"{0}\" }}"''', needs.release.outputs.number) || '' }}
This made it so the single quoted string to be parsed & remained a string as double quoted string to then be passed to the --config
argument.
Run tauri-apps/tauri-action@v0
with:
tauriScript: bun x tauri
args: --target x86_64-pc-windows-msvc --config '"{ \"version\": \"1.0.0-3000\" }"'
releaseId: 159[2](https://github.com/haleksandre/tauri-sveltekit/actions/runs/9402697312/job/25897435344#step:4:2)06869
releaseDraft: false
prerelease: false
projectPath: .
includeDebug: false
includeRelease: true
includeUpdaterJson: true
updaterJsonKeepUniversal: false
env:
CARGO_HOME: C:\Users\runneradmin/.cargo
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
TAURI_SIGNING_PRIVATE_KEY: ***
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ***
GITHUB_TOKEN: ***
running bun [
'x',
'tauri',
'build',
'--target',
'x86_64-pc-windows-msvc',
'--config',
'"{ \\"version\\": \\"1.0.0-3000\\" }"'
]
# ... building starting
I'm currently testing pre-releases & encountered the Wix numerical-only error.
First I tried the
appVersion
input, but it seems to only be used ontauri init
here:https://github.com/tauri-apps/tauri-action/blob/30a40ff2cb94468d761671ffa0fc20f1056bb3ec/src/build.ts#L46-L50
Next I tried to change the args to include
--config
flag on pre-release. Something along the line of thisIf I do not escape the " (double quote).
But somehow, even though it's valid JSON & works locally, it fails in the action regardless of how the JSON is passed. Is it a bug on how the --config flag gets processes here ?
https://github.com/tauri-apps/tauri-action/blob/30a40ff2cb94468d761671ffa0fc20f1056bb3ec/src/build.ts#L34-L38