Skip to content

Commit 75822b6

Browse files
committed
chore: update build configurations and file structure
- Add `coverage.txt` to the `.gitignore` file - Add `release` to the `.gitignore` file - Update the `builds` section in the `.goreleaser.yaml` file - Update the build command in the `Makefile` to include the `cmd/$(EXECUTABLE)` directory - Update the build commands in the `Makefile` for different architectures - Update the build commands in the `Makefile` for different operating systems - Update the installation instructions in the `README.md` file - Rename `main.go` to `cmd/codegpt/main.go` Signed-off-by: appleboy <appleboy.tw@gmail.com>
1 parent 0ec5940 commit 75822b6

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
1616
coverage.txt
17-
codegpt
1817
dist
1918
**/.DS_Store
2019
bin
20+
release

.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ builds:
7676
post:
7777
- cmd: xz -k -9 {{ .Path }}
7878
dir: ./dist/
79+
main: ./cmd/codegpt
7980

8081
archives:
8182
- format: binary

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ COMMIT ?= $(shell git rev-parse --short HEAD)
2020
build: $(EXECUTABLE)
2121

2222
$(EXECUTABLE): $(GOFILES)
23-
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@
23+
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@ ./cmd/$(EXECUTABLE)
2424

2525
install: $(GOFILES)
2626
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)'
@@ -29,16 +29,16 @@ test:
2929
@$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1
3030

3131
build_linux_amd64:
32-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/amd64/$(EXECUTABLE)
32+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/amd64/$(EXECUTABLE) ./cmd/$(EXECUTABLE)
3333

3434
build_linux_arm64:
35-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm64/$(EXECUTABLE)
35+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm64/$(EXECUTABLE) ./cmd/$(EXECUTABLE)
3636

3737
build_linux_arm:
38-
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm/$(EXECUTABLE)
38+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm/$(EXECUTABLE) ./cmd/$(EXECUTABLE)
3939

4040
build_mac_intel:
41-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/mac/intel/$(EXECUTABLE)
41+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/mac/intel/$(EXECUTABLE) ./cmd/$(EXECUTABLE)
4242

4343
build_windows_64:
44-
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/windows/intel/$(EXECUTABLE).exe
44+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/windows/intel/$(EXECUTABLE).exe ./cmd/$(EXECUTABLE)

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ $ codegpt version
4646
version: v0.4.3 commit: xxxxxxx
4747
```
4848

49+
Install from source code:
50+
51+
```sh
52+
go install github.com/appleboy/CodeGPT/cmd/codegpt@latest
53+
```
54+
4955
## Setup
5056

5157
Please first create your OpenAI API Key. The [OpenAI Platform](https://platform.openai.com/account/api-keys) allows you to generate a new API Key.
File renamed without changes.

0 commit comments

Comments
 (0)