Skip to content

Commit

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

* Fix the compress format issues

* Use tar xJ to uncompress tar file

* Backup git repo
  • Loading branch information
LinuxSuRen committed Nov 28, 2020
1 parent 8d16b49 commit eceb450
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Backup Git repository

on:
workflow_dispatch:
push:
branches:
- master

jobs:
BackupGit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Backup to Gitee
uses: jenkins-zh/git-backup-actions@v0.0.3
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "git@gitee.com:jenkins-zh/jcli-ishell-plugin.git"
- name: Backup to CodeChina
uses: jenkins-zh/git-backup-actions@v0.0.4
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "git@codechina.csdn.net:jenkins-zh/jcli-ishell-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/setup-go@v2.1.3
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NAME := jcli-ishell-plugin

build:
go build
upx $(NAME)
chmod u+x $(NAME)

copy: build
Expand Down

0 comments on commit eceb450

Please sign in to comment.