更新 localization.json #20
This file contains 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
# XXXXXXXX | |
name: Check Pull Request | |
on: | |
pull_request: | |
branches: [ '*' ] # 可以指定分支,或者用 * 表示所有分支 | |
push: | |
branches: [ '*' ] # 可以指定分支,或者用 * 表示所有分支 | |
paths: | |
- 'json/localization.json' # 仅当推送此文件时触发 | |
jobs: | |
Configuration_Environment: | |
runs-on: windows-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: utf8 | |
# 使用utf8编码环境编译 | |
run: chcp 65001 | |
- name: Download Data_json | |
shell: pwsh | |
run: Invoke-WebRequest -Uri "https://api.github.com/repos/desktop/desktop/releases/latest" -OutFile "${{github.workspace}}\release.json" | |
- name: Download GitHubDesktop2Chinese.exe | |
shell: pwsh | |
run: Invoke-WebRequest -Uri "https://github.com/cngege/GitHubDesktop2Chinese/releases/latest/download/GitHubDesktop2Chinese.exe" -OutFile "${{github.workspace}}\GitHubDesktop2Chinese.exe" | |
- name: Parse json_file,Read download url | |
shell: pwsh | |
id: forjson | |
run: | | |
$jsonContent = Get-Content -Path '${{github.workspace}}\release.json' -Raw | |
$jsonObj = ConvertFrom-Json -InputObject $jsonContent | |
if ( $($jsonObj.assets[4].browser_download_url) -like "*-x64-full.nupkg" ) { | |
Add-Content -Path $env:GITHUB_ENV -Value "browser_download_url=$($jsonObj.assets[4].browser_download_url)" | |
} else { | |
echo "下标为4的资源不是以 -x64-full.nupkg结尾,请手动打开链接确认..." | |
echo "https://api.github.com/repos/desktop/desktop/releases/latest" | |
exit 1 | |
} | |
- name: download github desktop | |
shell: pwsh | |
run: | | |
Invoke-WebRequest -Uri "${{env.browser_download_url}}" -OutFile "${{github.workspace}}\GitHubDesktop_full.zip" | |
- name: unzip GitHub Desktop Full | |
shell: pwsh | |
run: | | |
Expand-Archive -Path "${{github.workspace}}\GitHubDesktop_full.zip" -DestinationPath "${{github.workspace}}\GitHubDesktopFull" -Force | |
- name: run and check GitHubDesktop2Chinese.exe | |
shell: pwsh | |
run: | | |
${{github.workspace}}\GitHubDesktop2Chinese.exe --nopause -j "json/localization.json" -g "${{github.workspace}}\GitHubDesktopFull\lib\net45\resources\app" dev --invalidcheck | |
#- name: Test Tree | |
# shell: pwsh | |
# run: tree . /A /F |