@@ -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,19 @@ jobs:
148153 if : ${{ !github.event.inputs.test }}
149154 run : |
150155 # 设置Python使用UTF-8编码
151- [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
156+ ${{ runner.os == 'Windows' && ' [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')' || '' }}
152157 # 设置控制台编码为UTF-8
153- chcp.com 65001
158+ ${{ runner.os == 'Windows' && ' chcp.com 65001' || '' }}
154159 cd package
155160 python nuitka_build.py nuitka_config.yml
156161
157162 - name : Run Test packaging script
158163 if : ${{ github.event.inputs.test }}
159164 run : |
160165 # 设置Python使用UTF-8编码
161- [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')
166+ ${{ runner.os == 'Windows' && ' [System.Environment]::SetEnvironmentVariable('PYTHONUTF8', '1', 'Process')' || '' }}
162167 # 设置控制台编码为UTF-8
163- chcp.com 65001
168+ ${{ runner.os == 'Windows' && ' chcp.com 65001' || '' }}
164169 cd package
165170 python nuitka_build.py ${{ github.event.inputs.config_path }}
166171
0 commit comments