diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10dc1b3c7..e6addee2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ env: NET_FRAMEWORK_VERSION: net48 NODE_JS_VERSION: 12 STEAM_TOKEN_DUMPER_NAME: ArchiSteamFarm.OfficialPlugins.SteamTokenDumper + STEAM_TOKEN_DUMPER_TOKEN: ${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} jobs: build: @@ -66,6 +67,24 @@ jobs: - name: Run ArchiSteamFarm.Tests run: dotnet test ArchiSteamFarm.Tests -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo + - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Unix + if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-') + shell: sh + run: | + if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then + sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"; + fi + - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Windows + if: startsWith(matrix.os, 'windows-') + shell: pwsh + run: | + Set-StrictMode -Version Latest + $ErrorActionPreference = 'Stop' + $ProgressPreference = 'SilentlyContinue' + + if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' -PathType Leaf)) { + (Get-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs').Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' + } - name: Publish ArchiSteamFarm.OfficialPlugins.SteamTokenDumper for .NET Core run: dotnet publish "${{ env.STEAM_TOKEN_DUMPER_NAME }}" -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -o "out/${{ env.STEAM_TOKEN_DUMPER_NAME }}/${{ env.NET_CORE_VERSION }}" -p:UseAppHost=false --nologo @@ -133,7 +152,6 @@ jobs: for job in $jobs; do wait "$job" done - - name: Publish ArchiSteamFarm on Windows if: startsWith(matrix.os, 'windows-') env: @@ -204,7 +222,6 @@ jobs: } Get-Job | Receive-Job -Wait -AutoRemoveJob - - name: Upload ASF-generic continue-on-error: true uses: actions/upload-artifact@v2 diff --git a/.travis.yml b/.travis.yml index 4f6fed011..77cc3c948 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,10 @@ script: dotnet build ArchiSteamFarm.OfficialPlugins.SteamTokenDumper -c "$CONFIGURATION" -p:UseAppHost=false --nologo dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -p:UseAppHost=false --nologo + if [ -n "${STEAM_TOKEN_DUMPER_TOKEN-}" ] && [ -f "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs" ]; then + sed -i "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SharedInfo.cs"; + fi + dotnet publish "$STEAM_TOKEN_DUMPER_NAME" -c "$CONFIGURATION" -f "$NET_CORE_VERSION" -o "out/${STEAM_TOKEN_DUMPER_NAME}/${NET_CORE_VERSION}" -p:UseAppHost=false --nologo dotnet clean ArchiSteamFarm -c "$CONFIGURATION" -p:UseAppHost=false --nologo diff --git a/appveyor.yml b/appveyor.yml index 651a1b0b1..b67bd31f7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -157,6 +157,11 @@ after_test: $ProgressPreference = 'SilentlyContinue' + if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' -PathType Leaf)) { + (Get-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs').Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content 'ArchiSteamFarm.OfficialPlugins.SteamTokenDumper\SharedInfo.cs' + } + + dotnet publish "$env:STEAM_TOKEN_DUMPER_NAME" -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -o "out/$env:STEAM_TOKEN_DUMPER_NAME/$env:NET_CORE_VERSION" -p:UseAppHost=false --nologo