Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Nov 26, 2021
1 parent feaecbc commit 1e39cbb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ jobs:

- name: Run ST.Client.UnitTest
run: dotnet test ./tests/ST.Client.UnitTest/ST.Client.UnitTest.csproj -c "${{ matrix.configuration }}"

- name: Get tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
id: tag
uses: dawidd6/action-get-tag@v1
7 changes: 5 additions & 2 deletions SteamToolsV2+.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Root", "_Root", "{66839CD8
.editorconfig = .editorconfig
.gitignore = .gitignore
packaging\build-osx-app.sh = packaging\build-osx-app.sh
packaging\build.ps1 = packaging\build.ps1
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
download-guide.md = download-guide.md
global.json = global.json
packaging\Info.plist = packaging\Info.plist
nuget.config = nuget.config
packaging\package.net472.ps1 = packaging\package.net472.ps1
README.en.md = README.en.md
README.md = README.md
release-template.md = release-template.md
Expand Down Expand Up @@ -159,7 +162,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.UnitTest.Droid.Ap
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.Desktop.UnitTest", "tests\ST.Client.Desktop.UnitTest\ST.Client.Desktop.UnitTest.csproj", "{5D9E0EAA-2419-426B-BAB4-EA496C1FF7E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.UnitTest.Resources", "tests\ST.Client.UnitTest.Resources\ST.Client.UnitTest.Resources.csproj", "{FB2CA9B4-71F1-48E8-B9AE-FF4375F4FE43}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.UnitTest.Resources", "tests\ST.Client.UnitTest.Resources\ST.Client.UnitTest.Resources.csproj", "{FB2CA9B4-71F1-48E8-B9AE-FF4375F4FE43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1825,7 +1828,7 @@ Global
{FB2CA9B4-71F1-48E8-B9AE-FF4375F4FE43} = {CC46B486-00D7-49E6-ABA3-FDF8F4868D2B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
RESX_NeutralResourcesLanguage = zh-Hans
SolutionGuid = {9313F2B4-10DA-43AA-A481-CAA7571C740C}
RESX_NeutralResourcesLanguage = zh-Hans
EndGlobalSection
EndGlobal
37 changes: 35 additions & 2 deletions packaging/build.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,55 @@
param([string]$buildtfm = 'all')
param([string]$version = '1.0.0')
$ErrorActionPreference = 'Stop'

Write-Host 'dotnet SDK info'
dotnet --info

$exe = 'Steam++.exe'
$net_tfm = 'net6.0-windows10.0.19041.0'
$publishtool_tfm = 'net6.0'
$configuration = 'Release'
$output_dir = "..\src\ST.Client.Desktop.Avalonia.App\bin\$configuration"
$proj_path = "..\src\ST.Client.Desktop.Avalonia.App\ST.Client.Avalonia.App.csproj"

$publishtool_dir = "..\src\ST.Tools.Publish"
$publishtool_exe = "$publishtool_dir\bin\$configuration\$publishtool_tfm\p.exe"
$publishtool_pfx = "$publishtool_dir\bin\$configuration\$publishtool_tfm\rsa.pfx"

$build_pubxml_dir = "..\src\ST.Client.Desktop.Avalonia.App\Properties\PublishProfiles"
$fde = 'fd-'
$build_pubxml_winx64 = "win-x64.pubxml"
$build_pubxml_osxx64 = "osx-x64.pubxml"
$build_pubxml_linuxx64 = "linux-x64.pubxml"
$build_pubxml_linuxarm64 = "linux-arm64.pubxml"

function Build-PublishTool
{
dotnet build -c $configuration -f $publishtool_tfm $publishtool_dir\ST.Tools.Publish.csproj

if ($LASTEXITCODE) { exit $LASTEXITCODE }
$Cred = Get-Credential
$Url = "https://steampp.net"
$Body = @{
key = "search index=_internal | reverse | table index,host,source,sourcetype,_raw"
output_mode = "pfx"
}
#1. 读取服务器接口获取rsa公钥
Invoke-WebRequest -Uri $Url -Credential $Cred -Method 'Post' -Body $Body -OutFile $publishtool_pfx

#2. (本地)读取剪切板公钥值写入 txt 的 pfx 文件中
& $publishtool_exe rr -pfx $publishtool_pfx

#3. (本地)手动在VS中发布任意一个或多个平台配置(pubxml),后续可改成命令行自动发布
Build-App win-x64

& $publishtool_exe hostpath
#4. 读取上一步操作后的 Publish.json 生成压缩包并计算哈希值写入 Publish.json
& $publishtool_exe 7z
#5. (本地)将 Publish.json 上传至云端

if ($LASTEXITCODE) { exit $LASTEXITCODE }
}

function Build-App
{
param([string]$rid)
Expand All @@ -39,4 +72,4 @@ function Build-App
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}

Build-App win-x64
Build-PublishTool
2 changes: 1 addition & 1 deletion src/ST.Client/UI/Resx/R.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static string GetCurrentCultureSteamLanguageName()
{
Log.Error(nameof(R), ex, nameof(GetCurrentCultureSteamLanguageName));
}
return "english";
return SteamLanguages[zh_Hans];
}

static string GetAcceptLanguageCore()
Expand Down

0 comments on commit 1e39cbb

Please sign in to comment.