Skip to content

Commit

Permalink
Merge pull request #1936 from goplus/main
Browse files Browse the repository at this point in the history
ci
  • Loading branch information
xushiwei authored Jul 15, 2024
2 parents f209578 + 9ff7b67 commit 282fb2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
29 changes: 10 additions & 19 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2

version: 1
dist: ".dist"
dist: .dist

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
- go mod download

builds:
- id: gop
main: ./cmd/gop
binary: bin/gop
ldflags:
- -X github.com/goplus/gop/env.buildVersion=v{{.Version}}
- -X github.com/goplus/gop/env.buildDate={{.Date}}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/gop
binary: bin/gop
ldflags:
- -X github.com/goplus/gop/env.buildVersion=v{{.Version}}
- -X github.com/goplus/gop/env.buildDate={{.Date}}

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}{{.Version}}.{{ .Os }}-{{ .Arch }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
{{.ProjectName}}{{.Version}}.{{.Os}}-{{.Arch}}
{{- if .Arm}}v{{.Arm}}{{end}}
format_overrides:
- goos: windows
format: zip
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ RUN set -eux; \
BIN_DIR_SUFFIX=linux_$GOARCH; \
[ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \
[ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \
cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \
cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop $GOPROOT/bin/; \
else \
./all.bash; \
cp bin/gop bin/gopfmt $GOPROOT/bin/; \
cp bin/gop $GOPROOT/bin/; \
fi

FROM $BASE_IMAGE
Expand Down

0 comments on commit 282fb2d

Please sign in to comment.