Commit 6cabe21b2c

6cabe21b2c350506d3b7190b54d9c42ab4a0649a

parent: 65502f0d0e

Unsigned

Wraient <wraient.911@gmail.com> · 2025-02-14 15:37 UTC

ci/cd: Compress binaries only for release

Layout: unified · split

.github/workflows/ci-cd.yml +10
@@ -38,6 +38,11 @@ jobs:
38 ./Build/buildlinux 38 ./Build/buildlinux
39 mkdir -p release/linux 39 mkdir -p release/linux
40 mv curd-linux-x86_64 release/linux/ 40 mv curd-linux-x86_64 release/linux/
41 env:
42 GITHUB_EVENT_NAME: ${{ github.event_name }}
43 GITHUB_REF: ${{ github.ref }}
44 GITHUB_EVENT_HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
45 UPX: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'release:') }}
41 46
42 - name: Build macOS x86_64 binary 47 - name: Build macOS x86_64 binary
43 run: | 48 run: |
@@ -68,6 +73,11 @@ jobs:
68 ./Build/buildwindows 73 ./Build/buildwindows
69 mkdir -p release/windows 74 mkdir -p release/windows
70 mv curd-windows.exe release/windows 75 mv curd-windows.exe release/windows
76 env:
77 GITHUB_EVENT_NAME: ${{ github.event_name }}
78 GITHUB_REF: ${{ github.ref }}
79 GITHUB_EVENT_HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
80 UPX: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'release:') }}
71 81
72 - name: Upload Artifacts 82 - name: Upload Artifacts
73 uses: actions/upload-artifact@v4 83 uses: actions/upload-artifact@v4
Build/buildlinux +3 −1
@@ -1,2 +1,4 @@
1CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o curd-linux-x86_64 -ldflags="-s -w" -trimpath cmd/curd/main.go 1CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o curd-linux-x86_64 -ldflags="-s -w" -trimpath cmd/curd/main.go
2upx --best --ultra-brute curd-linux-x86_64\ No newline at end of file 2if [[ "$GITHUB_EVENT_NAME" == "push" && "$GITHUB_REF" == "refs/heads/main" && "$GITHUB_EVENT_HEAD_COMMIT_MESSAGE" == *"release:"* ]] || [[ "$UPX" == "true" ]]; then
3 upx --best --ultra-brute curd-linux-x86_64
4fi\ No newline at end of file
Build/buildwindows +3 −1
@@ -1,2 +1,4 @@
1GOOS=windows GOARCH=amd64 go build -o curd-windows.exe -ldflags "-s -w" ./cmd/curd/main.go 1GOOS=windows GOARCH=amd64 go build -o curd-windows.exe -ldflags "-s -w" ./cmd/curd/main.go
2upx --best --ultra-brute curd-windows.exe\ No newline at end of file 2if [[ "$GITHUB_EVENT_NAME" == "push" && "$GITHUB_REF" == "refs/heads/main" && "$GITHUB_EVENT_HEAD_COMMIT_MESSAGE" == *"release:"* ]] || [[ "$UPX" == "true" ]]; then
3 upx --best --ultra-brute curd-windows.exe
4fi\ No newline at end of file