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:
3838 ./Build/buildlinux
3939 mkdir -p release/linux
4040 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:') }}
4146
4247 - name: Build macOS x86_64 binary
4348 run: |
@@ -68,6 +73,11 @@ jobs:
6873 ./Build/buildwindows
6974 mkdir -p release/windows
7075 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:') }}
7181
7282 - name: Upload Artifacts
7383 uses: actions/upload-artifact@v4
Build/buildlinux +3 −1
@@ -1,2 +1,4 @@
11CGO_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 @@
11GOOS=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