Skip to content

Commit 96b4a9c

Browse files
committed
perf: update gh action
1 parent 0486111 commit 96b4a9c

2 files changed

Lines changed: 107 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,17 @@ jobs:
4040
- uses: actions/setup-go@v5
4141
with:
4242
go-version: 'stable' # The Go version to download (if necessary) and use.
43-
- name: Make Build
44-
id: make_build
45-
env:
46-
VERSION: ${{ steps.get_version.outputs.TAG }}
43+
- name: Install objcopy for cross-arch binaries
4744
run: |
48-
make all -s && ls build
49-
- name: Release Upload Assets
50-
uses: softprops/action-gh-release@v1
51-
if: startsWith(github.ref, 'refs/tags/')
45+
sudo apt-get update
46+
sudo apt-get install -y binutils binutils-aarch64-linux-gnu
47+
GOVERSION=$(go version | awk '{print $3}')
48+
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV
49+
- name: Build Binary
50+
uses: goreleaser/goreleaser-action@v6
5251
with:
53-
draft: true
54-
files: |
55-
build/*.gz
52+
distribution: goreleaser
53+
version: '~> v2'
54+
args: release --clean
5655
env:
5756
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
version: 2
2+
3+
project_name: wisp
4+
5+
builds:
6+
- id: archives-unix
7+
main: .
8+
binary: wisp
9+
- flags:
10+
- -trimpath
11+
ldflags:
12+
- -w -s
13+
- -X 'github.com/jumpserver/wisp/cmd.Version={{ .Tag }}'
14+
- -X 'github.com/jumpserver/wisp/cmd.BuildTime={{ .Date }}'
15+
- -X 'github.com/jumpserver/wisp/cmd.GitCommit={{ .ShortCommit }}'
16+
- -X 'github.com/jumpserver/wisp/cmd.GoVersion={{ .Env.GOVERSION }}'
17+
env:
18+
- CGO_ENABLED=0
19+
goos:
20+
- linux
21+
- darwin
22+
- windows
23+
- freebsd
24+
- openbsd
25+
- netbsd
26+
goarch:
27+
- amd64
28+
- arm64
29+
- mips64le
30+
- ppc64le
31+
- s390x
32+
- riscv64
33+
- loong64
34+
35+
- id: linux-deb
36+
main: .
37+
binary: wisp
38+
env:
39+
- CGO_ENABLED=0
40+
goos:
41+
- linux
42+
goarch:
43+
- amd64
44+
- arm64
45+
flags:
46+
- -trimpath
47+
ldflags:
48+
- -s -w
49+
- -X 'github.com/jumpserver/wisp/cmd.Version={{ .Tag }}'
50+
- -X 'github.com/jumpserver/wisp/cmd.BuildTime={{ .Date }}'
51+
- -X 'github.com/jumpserver/wisp/cmd.GitCommit={{ .ShortCommit }}'
52+
- -X 'github.com/jumpserver/wisp/cmd.GoVersion={{ .Env.GOVERSION }}'
53+
54+
hooks:
55+
post:
56+
- cmd: >-
57+
{{- if eq .Arch "arm64" -}}
58+
aarch64-linux-gnu-objcopy --remove-section .go.buildinfo "{{ .Path }}"
59+
{{- else -}}
60+
objcopy --remove-section .go.buildinfo "{{ .Path }}"
61+
{{- end -}}
62+
output: true
63+
64+
archives:
65+
- id: tarballs
66+
ids:
67+
- archives-unix
68+
formats:
69+
- tar.gz
70+
name_template: >-
71+
{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}
72+
files:
73+
- config_example.yml
74+
# use zip for windows archives
75+
format_overrides:
76+
- goos: windows
77+
format: zip
78+
79+
nfpms:
80+
- id: linux-packages
81+
ids:
82+
- linux-deb
83+
package_name: wisp
84+
formats:
85+
- deb
86+
file_name_template: >-
87+
{{ .PackageName }}_linux_{{ .Arch }}
88+
bindir: /usr/local/bin
89+
maintainer: JumpServer Dev <support@jumpserver.org>
90+
description: Wisp is the communication component between JumpServer terminal services and the Core API.
91+
homepage: https://github.com/jumpserver/wisp
92+
93+
checksum:
94+
name_template: checksums.txt
95+
96+
changelog:
97+
disable: true

0 commit comments

Comments
 (0)