Browse Source

增加自动构建

master 0.0.1
李栋 9 months ago
parent
commit
04503f88c2
  1. 22
      .drone.yml
  2. 2
      go.mod
  3. 2
      go.sum
  4. 12
      填坑记录.md

22
.drone.yml

@ -0,0 +1,22 @@
kind: pipeline
type: docker
name: default
steps:
- name: build
image: golang:alpine
commands:
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go build -o ./dist/core -i -ldflags="-w -s"
- env
# when:
# event: tag
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: api_key
base_url: https://git.sltapp.cn
files: dist/*
when:
event: tag

2
go.mod

@ -6,7 +6,7 @@ replace (
github.com/project-nano/core/imageserver => ./src/imageserver
github.com/project-nano/core/modules => ./src/modules
github.com/project-nano/core/task => ./src/task
github.com/project-nano/framework => ../framework
// github.com/project-nano/framework => ../framework
)
require (

2
go.sum

@ -18,6 +18,8 @@ github.com/project-nano/framework v0.0.0-20190628085503-2d531d8d83ea h1:N4QUSpjN
github.com/project-nano/framework v0.0.0-20190628085503-2d531d8d83ea/go.mod h1:tlK/6uw7c0RfqW9es+nbqhCTlJchGmHcPjTdhNUUxXo=
github.com/project-nano/framework v1.0.1 h1:7UVdCNVMeb9D5wRRACV0SohljlXmcYYFT93cLvXSIR8=
github.com/project-nano/framework v1.0.1/go.mod h1:tlK/6uw7c0RfqW9es+nbqhCTlJchGmHcPjTdhNUUxXo=
github.com/project-nano/framework v1.0.3 h1:5O5KX03CFHieIi7QB3o7GBveqPkCYFHyO3Abbrlb0i4=
github.com/project-nano/framework v1.0.3/go.mod h1:i97Rqyjj+QgNQUUIOiE9qbDlHhM2dTgZMFMd2oEqgK0=
github.com/project-nano/sonar v0.0.0-20190628085230-df7942628d6f h1:NorTDWkZl22V1v/2t0gG01ylSACOmjDmrGpN3R/Pbgg=
github.com/project-nano/sonar v0.0.0-20190628085230-df7942628d6f/go.mod h1:VYPy/Adnn0NLwbDfa/7vv12vWbftUqTHZzwt83Q5QAo=
github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=

12
填坑记录.md

@ -0,0 +1,12 @@
编译时出现错误
```
go build runtime/cgo: copying /Users/lidong/Library/Caches/go-build/9a/9a465fcfa6111a6399875422b9b667e976a81c8007ceb43890666aacd844e82c-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied
```
查看当前用户
```
sudo chown -R
```
授权
```
sudo chown -R lidong /usr/local/go/pkg/darwin_amd64/
```
Loading…
Cancel
Save