6 Commits

Author SHA1 Message Date
cnbattle 9b4ed9f580 del arm 2022-10-31 13:45:12 +08:00
cnbattle e431ebc97e U dockerfile 2022-10-29 11:03:45 +08:00
cnbattle a86f39abbb U golang to 1.19 2022-10-29 10:51:42 +08:00
cnbattle f34695b6ae U upx to v4.0.0 2022-10-29 10:42:58 +08:00
cnbattle ff652546da add Docker Pulls 2020-06-26 18:02:50 +08:00
cnbattle 569a2a387c 优化 2020-06-26 12:43:49 +08:00
13 changed files with 50 additions and 147 deletions
+12 -98
View File
@@ -9,7 +9,7 @@ platform:
steps:
- name: vet
pull: always
image: golang:1.14
image: golang:1.19
commands:
- make vet
volumes:
@@ -18,7 +18,7 @@ steps:
- name: lint
pull: always
image: golang:1.14
image: golang:1.19
commands:
- make lint
volumes:
@@ -27,7 +27,7 @@ steps:
- name: misspell
pull: always
image: golang:1.14
image: golang:1.19
commands:
- make misspell-check
volumes:
@@ -36,7 +36,7 @@ steps:
- name: test
pull: always
image: golang:1.14
image: golang:1.19
commands:
- make test
volumes:
@@ -58,7 +58,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.14
image: golang:1.19
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-upx-original"
environment:
@@ -70,7 +70,7 @@ steps:
- name: build-tag
pull: always
image: golang:1.14
image: golang:1.19
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-upx-original"
environment:
@@ -88,7 +88,7 @@ steps:
- name: executable
pull: always
image: golang:1.14
image: golang:1.19
commands:
- ./release/linux/amd64/drone-upx --help
@@ -133,6 +133,7 @@ trigger:
depends_on:
- testing
---
kind: pipeline
name: linux-arm64
@@ -144,7 +145,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.14
image: golang:1.19
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-upx-original"
environment:
@@ -156,7 +157,7 @@ steps:
- name: build-tag
pull: always
image: golang:1.14
image: golang:1.19
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-upx-original"
environment:
@@ -174,7 +175,7 @@ steps:
- name: executable
pull: always
image: golang:1.14
image: golang:1.19
commands:
- ./release/linux/arm64/drone-upx --help
@@ -219,92 +220,6 @@ trigger:
depends_on:
- testing
---
kind: pipeline
name: linux-arm
platform:
os: linux
arch: arm
steps:
- name: build-push
pull: always
image: golang:1.14
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-upx-original"
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.14
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-upx-original"
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name : upx
image: cnbattle/drone-upx
settings:
level: 9
save_file: ./release/linux/arm/drone-upx
original_file: ./release/linux/arm/drone-upx-original
- name: executable
pull: always
image: golang:1.14
commands:
- ./release/linux/arm/drone-upx --help
- name: dryrun
pull: always
image: plugins/docker:linux-arm
settings:
cache_from: cnbattle/drone-upx
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
repo: cnbattle/drone-upx
tags: linux-arm
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
cache_from: cnbattle/drone-upx
daemon_off: false
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: cnbattle/drone-upx
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- "refs/pull/**"
- "refs/tags/**"
depends_on:
- testing
---
kind: pipeline
name: release-binary
@@ -316,7 +231,7 @@ platform:
steps:
- name: build-all-binary
pull: always
image: golang:1.14
image: golang:1.19
commands:
- make release
when:
@@ -370,7 +285,6 @@ trigger:
depends_on:
- linux-amd64
- linux-arm64
- linux-arm
- release-binary
...
+3 -4
View File
@@ -1,11 +1,10 @@
FROM alpine
ADD https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.96-amd64_linux.tar.xz | tar -xOf - upx-3.96-amd64_linux/upx > /bin/upx && \
RUN apk add --no-cache ca-certificates xz && rm -rf /var/cache/apk/*
ADD https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-4.0.0-amd64_linux.tar.xz | tar -xOf - upx-4.0.0-amd64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
RUN /bin/upx --help
ADD release/linux/amd64/drone-upx /bin/
ENTRYPOINT ["/bin/drone-upx"]
+4 -4
View File
@@ -35,21 +35,21 @@ vet:
lint:
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/mgechev/revive; \
$(GO) install github.com/mgechev/revive@latest; \
fi
revive -config .revive.toml ./... || exit 1
.PHONY: misspell-check
misspell-check:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
$(GO) install github.com/client9/misspell/cmd/misspell@latest; \
fi
misspell -error $(SOURCES)
.PHONY: misspell
misspell:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
$(GO) install github.com/client9/misspell/cmd/misspell@latest; \
fi
misspell -w $(SOURCES)
@@ -80,7 +80,7 @@ release-dirs:
release-build:
@which gox > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/mitchellh/gox; \
$(GO) install github.com/mitchellh/gox@latest; \
fi
gox -os="$(TARGETS)" -arch="$(ARCHS)" -tags="$(TAGS)" -ldflags="-s -w $(LDFLAGS)" -output="$(DIST)/binaries/$(EXECUTABLE)-$(VERSION)-{{.OS}}-{{.Arch}}"
+3 -2
View File
@@ -1,10 +1,11 @@
# drone-upx
[![Build Status](https://cloud.drone.io/api/badges/cnbattle/drone-upx/status.svg)](https://cloud.drone.io/cnbattle/drone-upx)
[![LINK](https://img.shields.io/badge/link-Github-%23FF4D5B.svg?style=flat-square)](https://github.com/cnbattle/drone-upx)
[![LINK](https://img.shields.io/badge/link-Github-%23FF4D5B.svg)](https://github.com/cnbattle/drone-upx)
[![Go Report Card](https://goreportcard.com/badge/github.com/cnbattle/drone-upx)](https://goreportcard.com/report/github.com/cnbattle/drone-upx)
[![Docker Pulls](https://img.shields.io/docker/pulls/cnbattle/drone-upx.svg)](https://img.shields.io/docker/pulls/cnbattle/drone-upx.svg)
[![GoDoc](https://godoc.org/github.com/cnbattle/drone-upx?status.svg)](https://godoc.org/github.com/cnbattle/drone-upx)
[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=flat-square)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
## Use
```
+1
View File
@@ -1,3 +1,4 @@
// Package cmd cmd
package cmd
import (
+4 -5
View File
@@ -1,11 +1,10 @@
FROM plugins/base:linux-amd64
ADD https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.96-amd64_linux.tar.xz | tar -xOf - upx-3.96-amd64_linux/upx > /bin/upx && \
RUN apk add --no-cache ca-certificates xz && rm -rf /var/cache/apk/*
ADD https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-4.0.0-amd64_linux.tar.xz | tar -xOf - upx-4.0.0-amd64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
RUN apk add --no-cache ca-certificates && \
rm -rf /var/cache/apk/*
COPY release/linux/amd64/drone-upx /bin/
ENTRYPOINT ["/bin/drone-upx"]
-11
View File
@@ -1,11 +0,0 @@
FROM plugins/base:linux-arm
ADD https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.96-arm_linux.tar.xz | tar -xOf - upx-3.96-arm_linux/upx > /bin/upx && \
chmod a+x /bin/upx
RUN apk add --no-cache ca-certificates && \
rm -rf /var/cache/apk/*
COPY release/linux/arm/drone-upx /bin/
ENTRYPOINT ["/bin/drone-upx"]
+4 -5
View File
@@ -1,11 +1,10 @@
FROM plugins/base:linux-arm64
ADD https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.96-arm64_linux.tar.xz | tar -xOf - upx-3.96-arm64_linux/upx > /bin/upx && \
RUN apk add --no-cache ca-certificates xz && rm -rf /var/cache/apk/*
ADD https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-arm64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-4.0.0-arm64_linux.tar.xz | tar -xOf - upx-4.0.0-arm64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
RUN apk add --no-cache ca-certificates && \
rm -rf /var/cache/apk/*
COPY release/linux/arm64/drone-upx /bin/
ENTRYPOINT ["/bin/drone-upx"]
-9
View File
@@ -1,9 +0,0 @@
FROM microsoft/nanoserver:10.0.14393.1884
ADD https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz /usr/local
RUN xz -d -c /usr/local/upx-3.96-amd64_linux.tar.xz | tar -xOf - upx-3.96-amd64_linux/upx > /bin/upx && \
chmod a+x /bin/upx
COPY drone-upx.exe /drone-upx.exe
ENTRYPOINT [ "\\drone-upx.exe" ]
-6
View File
@@ -17,9 +17,3 @@ manifests:
architecture: arm64
os: linux
variant: v8
-
image: cnbattle/drone-upx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux
variant: v7
+3 -1
View File
@@ -1,11 +1,13 @@
// Package cmd main
package main
import (
"errors"
"github.com/cnbattle/drone-upx/cmd"
"log"
"os"
"github.com/cnbattle/drone-upx/cmd"
"github.com/urfave/cli/v2"
)
+8 -2
View File
@@ -1,5 +1,11 @@
module github.com/cnbattle/drone-upx
go 1.13
go 1.19
require github.com/urfave/cli/v2 v2.2.0
require github.com/urfave/cli/v2 v2.20.3
require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
)
+8
View File
@@ -0,0 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.20.3 h1:lOgGidH/N5loaigd9HjFsOIhXSTrzl7tBpHswZ428w4=
github.com/urfave/cli/v2 v2.20.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=