ModAPI.Common: remove LauncherSettings.ForceGamePath #252
Workflow file for this run
This file contains hidden or 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
| name: modapi-launcher-kit | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| env: | |
| nugetUrl: 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' | |
| modApiUrl: 'https://github.com/emd4600/Spore-ModAPI/releases/latest/download/SporeModAPIdlls.zip' | |
| legacyModApiUrl: 'https://github.com/emd4600/Spore-ModAPI/releases/latest/download/SporeModAPIlegacydlls.zip' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x86 | |
| - name: Install Nuget | |
| run: | | |
| Invoke-WebRequest "${env:nugetUrl}" -OutFile nuget.exe | |
| - name: Prepare Environment | |
| run: | | |
| $env:revision = git describe --tags --always | |
| echo "GIT_REVISION=$env:revision" >> $env:GITHUB_ENV | |
| - name: Restore Packages | |
| run: | | |
| nuget restore | |
| - name: Download Spore-ModAPI | |
| run: | | |
| Invoke-WebRequest "${env:modApiUrl}" -OutFile SporeModAPIdlls.zip | |
| Invoke-WebRequest "${env:legacyModApiUrl}" -OutFile SporeModAPIlegacydlls.zip | |
| - name: Build modapi-launcher-kit | |
| run: | | |
| msbuild /p:Configuration=Release /m | |
| - name: Remove PDB and XML files | |
| run: | | |
| remove-item Output\* -include *.pdb | |
| remove-item Output\* -include *.xml | |
| - name: Package ModApiUpdate.zip | |
| run: | | |
| & "C:\Program Files\7-Zip\7z.exe" e -y SporeModAPIdlls.zip -oOutput\coreLibs | |
| & "C:\Program Files\7-Zip\7z.exe" e -y SporeModAPIlegacydlls.zip -oOutput\ | |
| cd Output | |
| & "C:\Program Files\7-Zip\7z" a -tzip "..\ModApiUpdate.zip" * | |
| - name: Build ModAPI.InterimSetup | |
| run: | | |
| Copy -Force ModApiUpdate.zip Package\ModAPI.InterimSetup\Resources\ModApiUpdate.zip | |
| msbuild Package\ModAPI.InterimSetup /p:Configuration=Release | |
| - name: Build ModAPI.Updater | |
| run: | | |
| Copy -Force ModApiUpdate.zip Package\ModAPI.Updater\Resources\ModApiUpdate.zip | |
| msbuild Package\ModAPI.Updater /p:Configuration=Release | |
| - name: Upload ModAPI.InterimSetup | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ModAPI.InterimSetup-${{ env.GIT_REVISION }} | |
| path: Package/ModAPI.InterimSetup/bin/Release/*.exe | |
| - name: Upload ModAPI.Updater | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ModAPI.Updater-${{ env.GIT_REVISION }} | |
| path: Package/ModAPI.Updater/bin/Release/*.exe | |
| publish-github: | |
| runs-on: windows-2022 | |
| needs: [ build ] | |
| if: github.ref_type == 'tag' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare Environment | |
| run: | | |
| $env:revision = git describe --tags --always | |
| echo "GIT_REVISION=$env:revision" >> $env:GITHUB_ENV | |
| - name: Download ModAPI.InterimSetup | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ModAPI.InterimSetup-${{ env.GIT_REVISION }} | |
| path: artifact | |
| - name: Download ModAPI.Updater | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ModAPI.Updater-${{ env.GIT_REVISION }} | |
| path: artifact | |
| - name: Generate update.info | |
| run: | | |
| $updaterVersion = "1.0.0.0" | |
| $version = (($env:GIT_REVISION -split '\.')[0] -split 'v')[1] + "." ` | |
| + (($env:GIT_REVISION -split '\.')[1]) + "." ` | |
| + (($env:GIT_REVISION -split '\.')[2] -split '-')[0] + ".0" | |
| $downloadUrl = $env:GITHUB_SERVER_URL + "/" + $env:GITHUB_REPOSITORY ` | |
| + "/releases/latest/download/ModAPI.Updater.exe" | |
| echo $updaterVersion > update.info | |
| echo $version >> update.info | |
| echo "false" >> update.info | |
| echo $downloadUrl >> update.info | |
| Copy update.info artifact/update.info | |
| - name: Create Draft Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| draft: true | |
| makeLatest: true | |
| tag: ${{ env.GIT_REVISION }} | |
| artifacts: artifact/* | |
| publish-cloudflare: | |
| runs-on: windows-2022 | |
| needs: [ build ] | |
| if: github.ref_type == 'tag' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare Environment | |
| run: | | |
| $env:revision = git describe --tags --always | |
| echo "GIT_REVISION=$env:revision" >> $env:GITHUB_ENV | |
| - name: Download ModAPI.Updater | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ModAPI.Updater-${{ env.GIT_REVISION }} | |
| path: artifact | |
| - name: Generate update.info | |
| run: | | |
| $updaterVersion = "1.0.0.0" | |
| $version = (($env:GIT_REVISION -split '\.')[0] -split 'v')[1] + "." ` | |
| + (($env:GIT_REVISION -split '\.')[1]) + "." ` | |
| + (($env:GIT_REVISION -split '\.')[2] -split '-')[0] + ".0" | |
| $downloadUrl = "https://update.launcherkit.sporecommunity.com/ModAPI.Updater.exe" | |
| echo $updaterVersion > update.info | |
| echo $version >> update.info | |
| echo "false" >> update.info | |
| echo $downloadUrl >> update.info | |
| Copy update.info artifact/update.info | |
| - name: Upload to Cloudflare R2 | |
| uses: ryand56/[email protected] | |
| with: | |
| r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
| r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| r2-bucket: spore-modapi-launcherkit | |
| source-dir: artifact | |
| destination-dir: ./ | |
| - name: Purge Cloudflare Cache | |
| env: | |
| CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }} | |
| CF_PURGECACHE_TOKEN: ${{ secrets.CF_PURGECACHE_TOKEN }} | |
| run: | | |
| $params = @{ | |
| Method = 'POST' | |
| Uri = "https://api.cloudflare.com/client/v4/zones/$env:CF_ZONE_ID/purge_cache" | |
| Headers = @{Authorization="Bearer $env:CF_PURGECACHE_TOKEN"} | |
| Body = '{"hosts":["update.launcherkit.sporecommunity.com"]}' | |
| } | |
| Invoke-WebRequest @params |