Skip to content

Commit eceb450

Browse files
authored
Reduce the binary file size by upx (#7)
* Reduce the binary file size by upx * Fix the compress format issues * Use tar xJ to uncompress tar file * Backup git repo
1 parent 8d16b49 commit eceb450

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

.github/workflows/backup.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Backup Git repository
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
BackupGit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Backup to Gitee
15+
uses: jenkins-zh/[email protected]
16+
env:
17+
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
18+
TARGET_GIT: "[email protected]:jenkins-zh/jcli-ishell-plugin.git"
19+
- name: Backup to CodeChina
20+
uses: jenkins-zh/[email protected]
21+
env:
22+
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
23+
TARGET_GIT: "[email protected]:jenkins-zh/jcli-ishell-plugin.git"

.github/workflows/pull-request.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build:
1010
name: Build
11-
runs-on: macos-10.15
11+
runs-on: ubuntu-latest
1212
steps:
1313
- name: Set up Go 1.13
1414
uses: actions/[email protected]
@@ -24,6 +24,9 @@ jobs:
2424
args: check
2525
- name: Build
2626
run: |
27+
export PATH=$PATH:${PWD}/upx-3.96-amd64_linux
28+
curl -L https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz | tar xJ
29+
upx -V
2730
make build
2831
- name: Test
2932
run: |

.goreleaser.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ builds:
88
- amd64
99
- arm64
1010
goos:
11-
- freebsd
1211
- windows
1312
- linux
1413
- darwin
15-
ignore:
16-
- goos: freebsd
17-
goarch: arm64
14+
hooks:
15+
post:
16+
- upx "{{ .Path }}"
1817
ldflags:
1918
- -X github.com/jenkins-zh/jenkins-cli/app.version={{.Version}}
2019
- -X github.com/jenkins-zh/jenkins-cli/app.commit={{.ShortCommit}}
2120
- -X github.com/jenkins-zh/jenkins-cli/app.date={{.Date}}
21+
- -w
2222
dist: release
2323
archives:
2424
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
@@ -30,9 +30,9 @@ archives:
3030
arm64: arm64
3131
format_overrides:
3232
- goos: windows
33-
format: zipREADME.md
33+
format: zip
3434
files:
35-
-
35+
- README.md
3636
checksum:
3737
name_template: 'checksums.txt'
3838
snapshot:

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ NAME := jcli-ishell-plugin
22

33
build:
44
go build
5+
upx $(NAME)
56
chmod u+x $(NAME)
67

78
copy: build

0 commit comments

Comments
 (0)