mirror of https://github.com/go-gost/gost.git
add upx for binary compression
parent
d448628fea
commit
b593fdb952
|
|
@ -23,6 +23,10 @@ jobs:
|
|||
with:
|
||||
go-version: '1.24'
|
||||
cache: true
|
||||
- name: Install UPX
|
||||
uses: crazy-max/ghaction-upx@v3
|
||||
with:
|
||||
install-only: true
|
||||
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
||||
# on your needs.
|
||||
- uses: goreleaser/goreleaser-action@v6
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ name: Trigger nightly build
|
|||
on:
|
||||
schedule:
|
||||
# * is a special character in YAML, so you have to quote this string
|
||||
- cron: '30 15 * * *'
|
||||
- cron: '00 15 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -38,6 +38,67 @@ builds:
|
|||
ldflags:
|
||||
- "-s -w -X 'main.version={{ .Tag }}'"
|
||||
|
||||
upx:
|
||||
- # Whether to enable it or not.
|
||||
#
|
||||
# Templates: allowed.
|
||||
enabled: true
|
||||
|
||||
# Filter by build ID.
|
||||
# ids: [build1, build2]
|
||||
|
||||
# Filter by GOOS.
|
||||
goos: [linux]
|
||||
|
||||
# Filter by GOARCH.
|
||||
goarch: [arm, arm64, amd64]
|
||||
|
||||
# Filter by GOARM.
|
||||
# goarm: [8]
|
||||
|
||||
# Filter by GOAMD64.
|
||||
# goamd64: [v1]
|
||||
|
||||
# Compress argument.
|
||||
# Valid options are from '1' (faster) to '9' (better), and 'best'.
|
||||
compress: best
|
||||
|
||||
# Whether to try LZMA (slower).
|
||||
lzma: true
|
||||
|
||||
# Whether to try all methods and filters (slow).
|
||||
brute: true
|
||||
|
||||
- # Whether to enable it or not.
|
||||
#
|
||||
# Templates: allowed.
|
||||
enabled: true
|
||||
|
||||
# Filter by build ID.
|
||||
# ids: [build1, build2]
|
||||
|
||||
# Filter by GOOS.
|
||||
goos: [windows]
|
||||
|
||||
# Filter by GOARCH.
|
||||
goarch: [amd64]
|
||||
|
||||
# Filter by GOARM.
|
||||
# goarm: [8]
|
||||
|
||||
# Filter by GOAMD64.
|
||||
# goamd64: [v1]
|
||||
|
||||
# Compress argument.
|
||||
# Valid options are from '1' (faster) to '9' (better), and 'best'.
|
||||
compress: best
|
||||
|
||||
# Whether to try LZMA (slower).
|
||||
lzma: true
|
||||
|
||||
# Whether to try all methods and filters (slow).
|
||||
brute: true
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
# use zip for windows archives
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
|
|||
|
||||
FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.22 AS builder
|
||||
|
||||
# add upx for binary compression
|
||||
RUN apk add --no-cache upx || echo "upx not found"
|
||||
|
||||
COPY --from=xx / /
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
|
@ -17,8 +20,9 @@ WORKDIR /app
|
|||
COPY . .
|
||||
|
||||
RUN cd cmd/gost && \
|
||||
xx-go build && \
|
||||
xx-verify gost
|
||||
xx-go build -ldflags "-s -w" && \
|
||||
xx-verify gost && \
|
||||
{ upx --best gost || true; }
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue