-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
152 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# link on steamworks_sdk.zip file uploaded on google drive, should be created via "npm run steamworks-sdk:zip" that will protect zip with password | ||
STEAM_APP_ID=1904150 | ||
STEAMWORKS_SDK_ARCHIVE_PASSWORD=example-password-v$ePa6x4QHN%R8 | ||
# link on steamworks_sdk.zip uploaded on google drive, replace FILE_ID with your file id | ||
STEAMWORKS_SDK_GOOGLE_DRIVE_LINK=https://drive.google.com/uc?id=[FILE_ID]&export=download | ||
STEAMWORKS_SDK_ARCHIVE_PASSWORD=example-password-v$ePa6x4QHN%R8# | ||
# link on steamworks_auth_files.zip uploaded on google drive, replace FILE_ID with your file id | ||
STEAM_AUTH_FILES_GOOGLE_DRIVE_LINK=https://drive.google.com/uc?id=[FILE_ID]&export=download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require("dotenv").config(); | ||
const fs = require("fs"); | ||
const exec = require("child_process").execSync; | ||
|
||
const { checkRequiredEnvs } = require("./utils"); | ||
|
||
const { STEAM_APP_ID, RELEASE_BRANCH } = process.env; | ||
checkRequiredEnvs(["STEAM_APP_ID", "RELEASE_BRANCH"]); | ||
|
||
const packageJson = JSON.parse(fs.readFileSync("package.json")); | ||
|
||
const buildScript = `"AppBuild" | ||
{ | ||
"AppID" "${STEAM_APP_ID}" // your AppID | ||
"Desc" "v${packageJson.version}" // internal description for this build | ||
"SetLive" "${RELEASE_BRANCH}" | ||
"ContentRoot" "../content/" // root content folder, relative to location of this file | ||
"BuildOutput" "../output/" // build output folder for build logs and build cache files | ||
"Depots" | ||
{ | ||
"1904151" // your DepotID | ||
{ | ||
"FileMapping" | ||
{ | ||
"LocalPath" "*" // all files from contentroot folder | ||
"DepotPath" "." // mapped into the root of the depot | ||
"recursive" "1" // include all subfolders | ||
} | ||
} | ||
} | ||
}`.toString(); | ||
|
||
fs.writeFileSync( | ||
"./steamworks_sdk/tools/ContentBuilder/scripts/simple_build.vdf", | ||
buildScript | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require("dotenv").config(); | ||
const exec = require("child_process").execSync; | ||
|
||
const { checkRequiredEnvs } = require("./utils"); | ||
|
||
const { STEAM_AUTH_FILES_GOOGLE_DRIVE_LINK, STEAMWORKS_SDK_ARCHIVE_PASSWORD } = | ||
process.env; | ||
checkRequiredEnvs([ | ||
"STEAM_AUTH_FILES_GOOGLE_DRIVE_LINK", | ||
"STEAMWORKS_SDK_ARCHIVE_PASSWORD", | ||
]); | ||
|
||
try { | ||
exec( | ||
`curl -L "${STEAM_AUTH_FILES_GOOGLE_DRIVE_LINK}" > steam_auth_files.zip` | ||
); | ||
console.info("- [fetchSteamAuthFiles] donwloaded"); | ||
|
||
exec( | ||
`npx 7z-wasm x steam_auth_files.zip -o./steamworks_sdk/tools/ContentBuilder/builder -p${STEAMWORKS_SDK_ARCHIVE_PASSWORD} -aoa` | ||
); | ||
console.info("- [fetchSteamAuthFiles] unzipped"); | ||
} catch (err) { | ||
console.error(err); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require("dotenv").config(); | ||
const exec = require("child_process").execSync; | ||
|
||
const { checkRequiredEnvs } = require("./utils"); | ||
|
||
const { STEAMWORKS_SDK_GOOGLE_DRIVE_LINK, STEAMWORKS_SDK_ARCHIVE_PASSWORD } = | ||
process.env; | ||
checkRequiredEnvs([ | ||
"STEAMWORKS_SDK_GOOGLE_DRIVE_LINK", | ||
"STEAMWORKS_SDK_ARCHIVE_PASSWORD", | ||
]); | ||
|
||
try { | ||
exec(`curl -L "${STEAMWORKS_SDK_GOOGLE_DRIVE_LINK}" > steamworks_sdk.zip`); | ||
console.info("- [fetchSteamworksSdk] downloaded"); | ||
|
||
exec( | ||
`npx 7z-wasm x steamworks_sdk.zip -o./release/app/node_modules/greenworks/deps/steamworks_sdk -p${STEAMWORKS_SDK_ARCHIVE_PASSWORD} -aoa` | ||
); | ||
console.info("- [fetchSteamworksSdk] unzipped for greenworks"); | ||
|
||
exec( | ||
`npx 7z-wasm x steamworks_sdk.zip -o./steamworks_sdk -p${STEAMWORKS_SDK_ARCHIVE_PASSWORD} -aoa` | ||
); | ||
console.info("- [fetchSteamworksSdk] unzipped for steam build"); | ||
} catch (err) { | ||
console.error(err); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function checkRequiredEnvs(envNames) { | ||
const missingEnvs = envNames.filter((env) => !process.env[env]); | ||
if (missingEnvs.length > 0) { | ||
throw new Error( | ||
`Missing required environment variables: ${missingEnvs.join(", ")}` | ||
); | ||
} | ||
} | ||
|
||
module.exports = { checkRequiredEnvs }; |