# HG changeset patch # User sam # Date 1712131240 -25200 # Node ID a3428760e483de8ef0146b2e18220230ce6a1098 # Parent 7e164048c85cb23d54053912f43a5ff5fd24f616 fix: steamcmd not executable, implement steam-upload diff -r 7e164048c85c -r a3428760e483 semicongine/build.nim --- a/semicongine/build.nim Wed Apr 03 13:02:41 2024 +0700 +++ b/semicongine/build.nim Wed Apr 03 15:00:40 2024 +0700 @@ -8,6 +8,8 @@ import ./core/constants const BLENDER_CONVERT_SCRIPT = currentSourcePath().parentDir().parentDir().joinPath("tools/blender_gltf_converter.py") +const STEAMCMD_ZIP = currentSourcePath().parentDir().parentDir().joinPath("tools/steamcmd.zip") +const STEAM_DIR_NAME = "steam" proc semicongine_builddir*(buildname: string, builddir = "./build"): string = var platformDir = "unkown" @@ -32,15 +34,15 @@ proc semicongine_pack*(outdir: string, bundleType: string, resourceRoot: string) = switch("define", "PACKAGETYPE=" & bundleType) - rmDir(outdir) - mkDir(outdir) + outdir.rmDir() + outdir.mkDir() echo "BUILD: Packing assets from '" & resourceRoot & "' into directory '" & outdir & "'" let outdir_resources = joinPath(outdir, RESOURCEROOT) if bundleType == "dir": cpDir(resourceRoot, outdir_resources) elif bundleType == "zip": - mkDir(outdir_resources) + outdir_resources.mkDir() for resource in listDirs(resourceRoot): let outputfile = joinPath(outdir_resources, resource.splitPath().tail & ".zip") withdir resource: @@ -112,12 +114,21 @@ import_meshes meshfiles import_audio audiofiles -const STEAM_DIR_NAME = "steamcmd" -proc semicongine_steam*() = +# for steam-buildscript docs see https://partner.steamgames.com/doc/sdk/uploading +proc semicongine_steam_upload*(steamaccount, password, buildscript: string) = if not defined(linux): - echo "steam builds must be done on linux for now" + echo "steam uploads must be done on linux for now" return let steamdir = thisDir().joinPath(STEAM_DIR_NAME) if not dirExists(steamdir): + steamdir.mkDir + let zipFilename = STEAMCMD_ZIP.extractFilename + STEAMCMD_ZIP.cpFile(steamdir.joinPath(zipFilename)) + withDir(steamdir): + exec &"unzip {zipFilename}" + rmFile zipFilename + exec "steamcmd/steamcmd.sh +quit" # self-update steamcmd + + exec f"steamcmd/steamcmd.sh +login \"{steamaccount}\" \"{password}\" +run_app_build {buildscript} +quit" diff -r 7e164048c85c -r a3428760e483 tools/steamcmd.zip Binary file tools/steamcmd.zip has changed