Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the binary file size by upx #7

Merged
merged 4 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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