Skip to content

Commit da53c7a

Browse files
author
czyt
committed
fix release
1 parent 46539fc commit da53c7a

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,39 @@ jobs:
6464
fi
6565
6666
- name: Build
67+
shell: cmd
68+
if: runner.os == 'Windows'
69+
env:
70+
CC: ${{ matrix.cc }}
71+
run: |
72+
md build 2>nul || ver>nul
73+
md artifacts 2>nul || ver>nul
74+
make
75+
copy rime-deploy.exe artifacts\${{ matrix.artifact_name }}
76+
cd artifacts
77+
7z a -tzip ${{ matrix.asset_name }}.zip ${{ matrix.artifact_name }}
78+
79+
- name: Build (Unix)
6780
shell: bash
81+
if: runner.os != 'Windows'
6882
env:
6983
CC: ${{ matrix.cc }}
7084
run: |
71-
make CC=${{ matrix.cc }}
72-
73-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
74-
cp rime-deploy.exe artifacts/${{ matrix.artifact_name }}
75-
else
76-
cp rime-deploy artifacts/${{ matrix.artifact_name }}
77-
chmod +x artifacts/${{ matrix.artifact_name }}
78-
fi
79-
80-
# 创建压缩包
85+
mkdir -p build artifacts
86+
make
87+
cp rime-deploy artifacts/${{ matrix.artifact_name }}
88+
chmod +x artifacts/${{ matrix.artifact_name }}
8189
cd artifacts
82-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
83-
7z a -tzip ${{ matrix.asset_name }}.zip ${{ matrix.artifact_name }}
84-
else
85-
tar czf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}
86-
fi
87-
90+
tar czf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}
91+
8892
# 上传构建产物到 release
8993
- name: Upload Release Asset
9094
uses: softprops/action-gh-release@v1
9195
env:
9296
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9397
with:
9498
files: |
95-
artifacts/${{ matrix.asset_name }}*
99+
artifacts/${{ matrix.asset_name }}.*
96100
draft: false
97101
prerelease: false
98102
generate_release_notes: true

0 commit comments

Comments
 (0)