diff --git a/.github/workflows/backup.yaml b/.github/workflows/backup.yaml new file mode 100644 index 0000000..c083a4d --- /dev/null +++ b/.github/workflows/backup.yaml @@ -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" \ No newline at end of file diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 6d9509c..0d642fc 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -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 @@ -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: | diff --git a/.goreleaser.yml b/.goreleaser.yml index 73b8f67..3b8acb9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 }}" @@ -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: diff --git a/Makefile b/Makefile index 52796e6..cb8742c 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ NAME := jcli-ishell-plugin build: go build + upx $(NAME) chmod u+x $(NAME) copy: build