@@ -14,13 +14,13 @@ jobs:
14
14
include :
15
15
- os : ubuntu-latest
16
16
artifact_name : kiro2cc
17
- asset_name : kiro2cc-linux-amd64
17
+ asset_prefix : kiro2cc-linux-amd64
18
18
- os : windows-latest
19
19
artifact_name : kiro2cc.exe
20
- asset_name : kiro2cc-windows-amd64.exe
20
+ asset_prefix : kiro2cc-windows-amd64
21
21
- os : macos-latest
22
22
artifact_name : kiro2cc
23
- asset_name : kiro2cc-macos-amd64
23
+ asset_prefix : kiro2cc-macos-amd64
24
24
25
25
steps :
26
26
- name : Checkout code
@@ -35,12 +35,33 @@ jobs:
35
35
- name : Build
36
36
run : go build -v -o ${{ matrix.artifact_name }} .
37
37
38
+ - name : Install UPX
39
+ shell : bash
40
+ run : |
41
+ if [ "${{ runner.os }}" == "Linux" ]; then
42
+ sudo apt-get update && sudo apt-get install -y upx
43
+ elif [ "${{ runner.os }}" == "macOS" ]; then
44
+ brew install upx
45
+ elif [ "${{ runner.os }}" == "Windows" ]; then
46
+ choco install upx -y
47
+ fi
48
+
49
+ - name : Compress binary with UPX
50
+ shell : bash
51
+ run : |
52
+ upx --best --lzma ${{ matrix.artifact_name }}
53
+
54
+ - name : Extract version from tag
55
+ id : get_version
56
+ shell : bash
57
+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
58
+
38
59
- name : Upload Release Asset
39
60
uses : actions/upload-release-asset@v1
40
61
env :
41
62
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42
63
with :
43
64
upload_url : ${{ github.event.release.upload_url }}
44
65
asset_path : ./${{ matrix.artifact_name }}
45
- asset_name : ${{ matrix.asset_name }}
66
+ asset_name : ${{ matrix.asset_prefix }}-${{ steps.get_version.outputs.VERSION }}${{ endsWith(matrix.artifact_name, '.exe') && '.exe' || '' }}
46
67
asset_content_type : application/octet-stream
0 commit comments