From 28c869f177d38f4e7e72b3848be918111b0c557b Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 31 Jul 2020 21:02:33 +0200 Subject: [PATCH] Move crowdin strings upload from AppVeyor to Github Actions --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ appveyor.yml | 14 -------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f44cb5004..9f7128a2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: [push, pull_request] env: CONFIGURATION: Release + CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }} + CROWDIN_PROJECT_IDENTIFIER: archisteamfarm DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SDK_VERSION: 3.1.x DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 @@ -67,6 +69,25 @@ jobs: - name: Run ArchiSteamFarm.Tests run: dotnet test ArchiSteamFarm.Tests -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo + - name: Upload latest strings for translation on Crowdin + continue-on-error: true + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && startsWith(matrix.os, 'windows-') }} + shell: pwsh + run: | + Set-StrictMode -Version Latest + $ErrorActionPreference = 'Stop' + $ProgressPreference = 'SilentlyContinue' + + if ((Test-Path 'crowdin.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\crowdin_identity_example.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\archi.ps1' -PathType Leaf)) { + (Get-Content 'tools\ArchiCrowdin\crowdin_identity_example.yml').Replace('CROWDIN_API_KEY', "$env:CROWDIN_API_KEY").Replace('CROWDIN_PROJECT_IDENTIFIER', "$env:CROWDIN_PROJECT_IDENTIFIER") | Set-Content 'tools\ArchiCrowdin\crowdin_identity.yml' + + try { + & tools\ArchiCrowdin\archi.ps1 -u + } finally { + Remove-Item 'tools\ArchiCrowdin\crowdin_identity.yml' + } + } + - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Unix if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-') shell: sh @@ -75,6 +96,7 @@ jobs: sed "s/STEAM_TOKEN_DUMPER_TOKEN/${STEAM_TOKEN_DUMPER_TOKEN}/g" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" > "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new" mv "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs.new" "${STEAM_TOKEN_DUMPER_NAME}/SharedInfo.cs" fi + - name: Prepare ArchiSteamFarm.OfficialPlugins.SteamTokenDumper on Windows if: startsWith(matrix.os, 'windows-') shell: pwsh @@ -86,6 +108,7 @@ jobs: if ((Test-Path env:STEAM_TOKEN_DUMPER_TOKEN) -and (Test-Path "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs" -PathType Leaf)) { (Get-Content "$env:STEAM_TOKEN_DUMPER_NAME\SharedInfo.cs").Replace('STEAM_TOKEN_DUMPER_TOKEN', "$env:STEAM_TOKEN_DUMPER_TOKEN") | Set-Content "$env:STEAM_TOKEN_DUMPER_NAME\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 @@ -153,6 +176,7 @@ jobs: for job in $jobs; do wait "$job" done + - name: Publish ArchiSteamFarm on Windows if: startsWith(matrix.os, 'windows-') env: @@ -237,6 +261,7 @@ jobs: } Get-Job | Receive-Job -Wait -AutoRemoveJob + - name: Upload ASF-generic continue-on-error: true uses: actions/upload-artifact@v2 diff --git a/appveyor.yml b/appveyor.yml index da00c7337..3bad3955b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,9 +6,6 @@ image: Visual Studio 2019 configuration: Release clone_depth: 10 environment: - CROWDIN_API_KEY: - secure: oGuZaQo2z5/JkEYaKrD9Ing+TgwZ3qQVf+9Jdz73Fephy04z5rWPGCCtkjaMLTcY - CROWDIN_PROJECT_IDENTIFIER: archisteamfarm DOTNET_CHANNEL: 3.1 DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_INSTALL_DIR: C:\Program Files\dotnet @@ -267,17 +264,6 @@ after_test: Get-Job | Receive-Job -Wait -AutoRemoveJob - - - if (!($env:APPVEYOR_PULL_REQUEST_NUMBER) -and ($env:APPVEYOR_REPO_BRANCH -eq 'master') -and ($env:APPVEYOR_REPO_TAG -eq 'false') -and (Test-Path 'crowdin.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\crowdin_identity_example.yml' -PathType Leaf) -and (Test-Path 'tools\ArchiCrowdin\archi.ps1' -PathType Leaf)) { - (Get-Content 'tools\ArchiCrowdin\crowdin_identity_example.yml').Replace('CROWDIN_API_KEY', "$env:CROWDIN_API_KEY").Replace('CROWDIN_PROJECT_IDENTIFIER', "$env:CROWDIN_PROJECT_IDENTIFIER") | Set-Content 'tools\ArchiCrowdin\crowdin_identity.yml' - - try { - & tools\ArchiCrowdin\archi.ps1 -u - } finally { - Remove-Item 'tools\ArchiCrowdin\crowdin_identity.yml' - } - } deploy: off notifications: - provider: Webhook