mirror of https://github.com/go-gost/gost.git
add upx for binary compression
parent
d448628fea
commit
b593fdb952
|
|
@ -23,6 +23,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
go-version: '1.24'
|
go-version: '1.24'
|
||||||
cache: true
|
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
|
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
||||||
# on your needs.
|
# on your needs.
|
||||||
- uses: goreleaser/goreleaser-action@v6
|
- uses: goreleaser/goreleaser-action@v6
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ name: Trigger nightly build
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# * is a special character in YAML, so you have to quote this string
|
# * is a special character in YAML, so you have to quote this string
|
||||||
- cron: '30 15 * * *'
|
- cron: '00 15 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,67 @@ builds:
|
||||||
ldflags:
|
ldflags:
|
||||||
- "-s -w -X 'main.version={{ .Tag }}'"
|
- "-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:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
# use zip for windows archives
|
# 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
|
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 / /
|
COPY --from=xx / /
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
|
|
@ -17,8 +20,9 @@ WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN cd cmd/gost && \
|
RUN cd cmd/gost && \
|
||||||
xx-go build && \
|
xx-go build -ldflags "-s -w" && \
|
||||||
xx-verify gost
|
xx-verify gost && \
|
||||||
|
{ upx --best gost || true; }
|
||||||
|
|
||||||
FROM alpine:3.22
|
FROM alpine:3.22
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue