Skip to content

Commit cafcac9

Browse files
committed
create release
1 parent db2a412 commit cafcac9

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

.github/workflows/build.yml

+39-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Build
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
5+
branches:
6+
- main
7+
- zh-CN
8+
workflow_dispatch:
89

910
permissions:
10-
contents: read
11+
actions: write
12+
contents: write
1113

1214
jobs:
1315
build:
@@ -28,6 +30,8 @@ jobs:
2830

2931
steps:
3032
- uses: actions/checkout@v4
33+
with:
34+
ref: 'zh-CN'
3135

3236
- name: Add MSBuild to PATH
3337
uses: microsoft/setup-msbuild@v2
@@ -40,6 +44,17 @@ jobs:
4044
working-directory: ${{env.GITHUB_WORKSPACE}}
4145
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}
4246

47+
- name: Pack builds
48+
working-directory: ${{env.GITHUB_WORKSPACE}}
49+
run: |
50+
mkdir shell-${{matrix.platform}}
51+
rm -r ${{env.BIN_PATH}}\*.lib
52+
rm -r ${{env.BIN_PATH}}\*.exp
53+
rm -r ${{env.BIN_PATH}}\*.wixpdb
54+
rm -r ${{env.BIN_PATH}}\ca.dll
55+
Copy-Item -Path ${{env.BIN_PATH}}\* -Destination shell-${{matrix.platform}} -Recurse
56+
Compress-Archive -Path shell-${{matrix.platform}} -DestinationPath shell-${{matrix.platform}}.zip
57+
4358
- name: Upload artifacts
4459
uses: actions/upload-artifact@v4
4560
with:
@@ -55,3 +70,23 @@ jobs:
5570
compression-level: 6
5671
overwrite: false
5772
include-hidden-files: false
73+
74+
- name: Create release
75+
continue-on-error: true
76+
uses: ncipollo/release-action@v1.14.0
77+
with:
78+
name: 中文汉化
79+
allowUpdates: true
80+
tag: zh-CN
81+
commit: zh-CN
82+
replacesArtifacts: true
83+
token: ${{ secrets.GITHUB_TOKEN }}
84+
artifacts: "shell-${{matrix.platform}}.zip"
85+
86+
- name: Delete workflow runs
87+
uses: Mattraks/delete-workflow-runs@main
88+
with:
89+
token: ${{ secrets.GITHUB_TOKEN }}
90+
repository: ${{ github.repository }}
91+
retain_days: 0
92+
keep_minimum_runs: 2

0 commit comments

Comments
 (0)