forked from Naoko-simple/Clash_Chinese_Patch
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (140 loc) · 5.53 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
tags:
- '*.*.*'
workflow_dispatch:
inputs:
version:
description: '指定 Clash for Windows 的版本 (X.X.X)'
required: true
default: ''
type: string
jobs:
build:
name: Build
if: ${{ github.event_name == 'push' }}
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
- name: Clone BoyceLig/ClashSinicizationTool Repository
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'BoyceLig'
repository: 'ClashSinicizationTool'
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup NuGet
shell: pwsh
run: |
cd ./ClashSinicizationTool
dotnet nuget update source
nuget restore ClashSinicizationTool.sln
- name: Build .NET App
shell: pwsh
run: |
cd ./ClashSinicizationTool
./build_cli.ps1 app
- name: Unpack ClashSinicizationTool & Copy Project Files
shell: pwsh
run: |
if (-not (Test-Path ./Build)) { New-Item -Path ./ -Name Build -ItemType Directory }
Copy-Item -Path ./ClashSinicizationTool/Dist/Release/ -Destination ./Build/ClashSinicizationTool/ -Recurse -Force
Copy-Item -Path ./翻译脚本.txt -Destination ./Build/ClashSinicizationTool/ -Force
Copy-Item -Path ./moment-with-CN.js -Destination ./Build/ClashSinicizationTool/ -Force
- name: Get Tag
id: get_tag
uses: dawidd6/action-get-tag@v1
- name: Download Clash for Windows
uses: robinraju/[email protected]
with:
repository: "Fndroid/clash_for_windows_pkg"
tag: ${{ steps.get_tag.outputs.tag }}
fileName: "Clash.for.Windows-${{ steps.get_tag.outputs.tag }}-win.7z"
tarBall: false
zipBall: false
out-file-path: "downloads"
- name: Unpack Clash for Windows & Sinicization
shell: pwsh
run: |
7z x ./downloads/Clash.for.Windows-${{ steps.get_tag.outputs.tag }}-win.7z -o"./Build/Clash"
./Build/ClashSinicizationTool/CLI.exe -c ./Build/Clash -t ./Build/ClashSinicizationTool/翻译脚本.txt -o ./Build
- name: Package Asar
shell: pwsh
run: |
7z a -mx9 "./Build/app.7z" "./Build/app.asar"
Compress-Archive -Path "./Build/app.asar" -DestinationPath "./Build/app.zip"
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Clash for Windows v${{ steps.get_tag.outputs.tag }} 汉化补丁
prerelease: false
draft: false
artifacts: "./Build/app.7z,./Build/app.zip"
body: |
[![](https://img.shields.io/badge/Channel-blue?label=Telegram&logo=telegram)](https://t.me/ClashR_for_Windows_Channel) [![](https://img.shields.io/badge/Group-green?label=Telegram&logo=telegram)](https://t.me/+Se4RSc06w8QK1HiS)
⚠️汉化永久免费,请注意欺诈!!!
## 汉化方法:
下载 `app.7z` 或 `app.zip` 文件(*两个压缩包内容一样*)后,解压压缩包,请自行替换下列路径中的 `app.asar` 文件
`Clash for Windows\resources\app.asar`
manual:
name: Manual
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
- name: Clone BoyceLig/ClashSinicizationTool Repository
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'BoyceLig'
repository: 'ClashSinicizationTool'
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup NuGet
shell: pwsh
run: |
cd ./ClashSinicizationTool
dotnet nuget update source
nuget restore ClashSinicizationTool.sln
- name: Build .NET App
shell: pwsh
run: |
cd ./ClashSinicizationTool
./build_cli.ps1 app
- name: Unpack ClashSinicizationTool & Copy Project Files
shell: pwsh
run: |
if (-not (Test-Path ./Build)) { New-Item -Path ./ -Name Build -ItemType Directory }
Copy-Item -Path ./ClashSinicizationTool/Dist/Release/ -Destination ./Build/ClashSinicizationTool/ -Recurse -Force
Copy-Item -Path ./翻译脚本.txt -Destination ./Build/ClashSinicizationTool/ -Force
Copy-Item -Path ./moment-with-CN.js -Destination ./Build/ClashSinicizationTool/ -Force
- name: Download Clash for Windows
uses: robinraju/[email protected]
with:
repository: "Fndroid/clash_for_windows_pkg"
tag: ${{ inputs.version }}
fileName: "Clash.for.Windows-${{ inputs.version }}-win.7z"
tarBall: false
zipBall: false
out-file-path: "downloads"
- name: Unpack Clash for Windows & Sinicization
shell: pwsh
run: |
7z x ./downloads/Clash.for.Windows-${{ inputs.version }}-win.7z -o"./Build/Clash"
./Build/ClashSinicizationTool/CLI.exe -c ./Build/Clash -t ./Build/ClashSinicizationTool/翻译脚本.txt -o ./Build
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: app-${{ inputs.version }}
path: ./Build/app.asar