Skip to content

Commit

Permalink
Reduce the binary file size by upx (#6)
Browse files Browse the repository at this point in the history
* Reduce the binary file size by upx

* Use ubuntu instead of macos to build
  • Loading branch information
LinuxSuRen authored Nov 28, 2020
1 parent 6d23bec commit 3e1f838
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ jobs:
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "[email protected]:jenkins-zh/jcli-casc-plugin.git"
- name: Backup to CodeChina
uses: jenkins-zh/[email protected]
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "[email protected]:jenkins-zh/jcli-casc-plugin.git"
5 changes: 4 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:
name: Build
runs-on: macos-10.15
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/[email protected]
Expand All @@ -24,6 +24,9 @@ jobs:
args: check
- name: Build
run: |
export PATH=$PATH:${PWD}/upx-3.96-amd64_linux
curl -L https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz | tar xJ
upx -V
make build
- name: Test
run: |
Expand Down
12 changes: 6 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ builds:
- amd64
- arm64
goos:
- freebsd
- windows
- linux
- darwin
ignore:
- goos: freebsd
goarch: arm64
hooks:
post:
- upx "{{ .Path }}"
ldflags:
- -X github.com/jenkins-zh/jenkins-cli/app.version={{.Version}}
- -X github.com/jenkins-zh/jenkins-cli/app.commit={{.ShortCommit}}
- -X github.com/jenkins-zh/jenkins-cli/app.date={{.Date}}
- -w
dist: release
archives:
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
Expand All @@ -30,9 +30,9 @@ archives:
arm64: arm64
format_overrides:
- goos: windows
format: zipREADME.md
format: zip
files:
-
- README.md
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down

0 comments on commit 3e1f838

Please sign in to comment.