workflow: rules: - if: $CI_COMMIT_TAG when: always - when: never variables: GIT_STRATEGY: none GIT_CHECKOUT: "false" ErrorActionPreference: STOP GIT_TEST_DEBUG_UNSAFE_DIRECTORIES: "true" # Unreal Engine 4 Project Settings MOD_NAME: "RefinedRDApi" MOD_REPO: "refined-rd/sf_mod_refinedrdapi.git" MOD_ID: "B24emzbs6xVZQr" SML_DIR: "E:/SF/SML" ENGINE_DIR: "F:/5.2.1-CSS" BUILT_MODS_DIR: "$CI_PROJECT_DIR/BuiltMods" DEV_BUILDS_DIR: "$CI_PROJECT_DIR/DevBuilds" stages: - setup - compile - build - package - deploy 1-pull-sml: stage: setup script: - "if (!(Test-Path $BUILT_MODS_DIR)) {New-Item -ItemType Directory -Force -Path $BUILT_MODS_DIR}" - "if (!(Test-Path $DEV_BUILDS_DIR)) {New-Item -ItemType Directory -Force -Path $DEV_BUILDS_DIR}" - "Remove-Item $BUILT_MODS_DIR/*" - "Remove-Item $DEV_BUILDS_DIR/*" - "if (!(Test-Path $SML_DIR -PathType Container)) {git clone --branch master https://github.com/satisfactorymodding/SatisfactoryModLoader.git $SML_DIR}" 2-install-wwise: stage: setup variables: WWISE_VERSION: "2022.1.5.8242" script: - "cd $SML_DIR" - "if ((Test-Path $SML_DIR/Plugins/Wwise) -eq $true){ exit 0 }" - 'E:/SF/Scripts/wwise-cli.exe integrate-ue --integration-version "2022.1.5.2714" --project "$SML_DIR/FactoryGame.uproject"' 3-pull-mod: stage: setup script: - "cd $SML_DIR/Mods" - "if (!(Test-Path $SML_DIR/Mods/$MOD_NAME -PathType Container)) {git clone --branch ue5 git@10.10.10.6:$MOD_REPO $SML_DIR/Mods/$MOD_NAME}" - "cd $SML_DIR/Mods/$MOD_NAME" - "git fetch --all" - "git reset --hard origin/ue5" 4-header-update: stage: setup script: - "cd E:/SF/Scripts/sml-fixer" - "./sml-fixer.exe" 1-gen-vs-files: stage: compile script: - "cd $SML_DIR" - '& "$ENGINE_DIR/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.exe" -projectfiles -project="$SML_DIR/FactoryGame.uproject" -game -rocket -progress' 2-compile-editor: stage: compile script: - '& "$ENGINE_DIR/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.exe" Development Win64 -project="$SML_DIR/FactoryGame.uproject" -TargetType="Editor" -progress' 1-build-mod: stage: build script: - "$UPlugin = (Get-Content $SML_DIR/Mods/$MOD_NAME/$MOD_NAME.uplugin | convertfrom-json)" - '$UPlugin.SemVersion = $(Get-Content "$SML_DIR/Mods/$MOD_NAME/VERSION")' - '$UPlugin.VersionName = $(Get-Content "$SML_DIR/Mods/$MOD_NAME/VERSION")' - '$Version="$($UPlugin.SemVersion)"' - "($UPlugin | convertto-json -Depth 100) -replace '\\u0026', '&' | Set-Content $SML_DIR/Mods/$MOD_NAME/$MOD_NAME.uplugin" - 'Write-Host "Building $MOD_NAME $($Version)"' - '& "$ENGINE_DIR/Engine/Build/BatchFiles/RunUAT.bat" -ScriptsForProject="$SML_DIR/FactoryGame.uproject" PackagePlugin -Project="$SML_DIR/FactoryGame.uproject" -dlcname="$MOD_NAME" -build -server -clientconfig=Shipping -serverconfig=Shipping -platform=Win64 -serverplatform=Win64+Linux -nocompileeditor -installed -merge' - 'Copy-Item "$SML_DIR/Saved/ArchivedPlugins/$MOD_NAME/$MOD_NAME.zip" "$BUILT_MODS_DIR/$MOD_NAME.$Version.zip" -Force' artifacts: paths: - ./BuiltMods/*.zip expire_in: 1 month deploy-live: stage: deploy script: - 'cd "$CI_PROJECT_DIR"' - '$File = (Get-ChildItem "./BuiltMods/$MOD_NAME*").FullName' - '$APIURL="https://api.ficsit.app"' - '& "E:/SF/Scripts/ficsit_windows_amd64.exe" smr upload --api-base $APIURL --api-key $FICSIT_TOKEN "$MOD_ID" "$File" "$CHANGELOG"' when: manual