@@ -35,13 +35,18 @@ jobs:
3535 contents : write # 允许创建发布和上传资源
3636
3737 steps :
38- - name : Set Timezone to China Standard Time
39- run : tzutil /s "China Standard Time"
40- shell : pwsh
4138
4239 - name : Checkout code
4340 uses : actions/checkout@v4
4441
42+ - name : Set Timezone to China Standard Time on Windows
43+ if : ${{ runner.os == 'Windows' }}
44+ run : tzutil /s "China Standard Time"
45+ shell : pwsh
46+
47+ - name : Set Timezone to China Standard Time on Linux
48+ if : ${{ runner.os == 'Linux' }}
49+ run : sudo timedatectl set-timezone Asia/Shanghai
4550
4651
4752 - name : Set up Python
@@ -148,19 +153,21 @@ jobs:
148153 if : ${{ !github.event.inputs.test }}
149154 run : |
150155 # 设置Python使用UTF-8编码
151- [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
156+ ${{ runner.os == "Windows" && "
157+ [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')" || "" }}
152158 # 设置控制台编码为UTF-8
153- chcp.com 65001
159+ ${{ runner.os == 'Windows' && ' chcp.com 65001' || '' }}
154160 cd package
155161 python nuitka_build.py nuitka_config.yml
156162
157163 - name : Run Test packaging script
158164 if : ${{ github.event.inputs.test }}
159165 run : |
160166 # 设置Python使用UTF-8编码
161- [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
167+ ${{ runner.os == "Windows" && "
168+ [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')" || "" }}
162169 # 设置控制台编码为UTF-8
163- chcp.com 65001
170+ ${{ runner.os == 'Windows' && ' chcp.com 65001' || '' }}
164171 cd package
165172 python nuitka_build.py ${{ github.event.inputs.config_path }}
166173
0 commit comments