Move crowdin strings upload from AppVeyor to Github Actions

This commit is contained in:
JustArchi 2020-07-31 21:02:33 +02:00
parent a003db77e4
commit 28c869f177
2 changed files with 25 additions and 14 deletions

View file

@ -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

View file

@ -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