From c61f952357b7b86014701ae215d5d52aedfc8095 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 14 Feb 2024 22:53:29 +0700 Subject: [PATCH] Slimmer build size --- .github/workflows/release.yml | 14 +++++++------- Makefile | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c05f5b4..5c62292 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.22' - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build Binary run: make build-ci @@ -41,8 +41,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/proxy-fix-linux-amd64 - asset_name: proxy-fix-linux-amd64 + asset_path: ./build/proxy-fix-linux-amd64.tar.gz + asset_name: proxy-fix-linux-amd64.tar.gz asset_content_type: application/octet-stream - name: Upload Release Asset ARM64 @@ -52,6 +52,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/proxy-fix-linux-arm64 - asset_name: proxy-fix-linux-arm64 + asset_path: ./build/proxy-fix-linux-arm64.tar.gz + asset_name: proxy-fix-linux-arm64.tar.gz asset_content_type: application/octet-stream diff --git a/Makefile b/Makefile index bebc00d..49967e6 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,10 @@ build: chmod +x ./build/proxy-fix build-ci: - env GOOS=linux GOARCH=amd64 go build -o ./build/proxy-fix-linux-amd64 ./... - env GOOS=linux GOARCH=arm64 go build -o ./build/proxy-fix-linux-arm64 ./... + env GOOS=linux GOARCH=amd64 go build -o ./build/proxy-fix-linux-amd64 -ldflags="-w -s" ./... + env GOOS=linux GOARCH=arm64 go build -o ./build/proxy-fix-linux-arm64 -ldflags="-w -s" ./... + tar -zcvf ./build/proxy-fix-linux-amd64.tar.gz ./build/proxy-fix-linux-amd64 + tar -zcvf ./build/proxy-fix-linux-arm64.tar.gz ./build/proxy-fix-linux-arm64 run: env PORT=8080 go run . bun ./test/app.ts