Travis CI找不到GitHub部署的发布文件

时间:2019-08-23 10:26:06

标签: go build travis-ci continuous-deployment

尽管在SO上尝试了其他答案,但我无法让Travis CI找到要部署的发布文件夹。

我有一个运行如下版本的Makefile:

release:
        mkdir -p release
        env GOOS=linux GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-linux-amd64 $(BINARY_NAME_CLI)
        env GOOS=darwin GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-darwin-amd64 $(BINARY_NAME_CLI)
        env GOOS=windows GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-windows-amd64.exe $(BINARY_NAME_CLI)
        echo Releases in $(pwd)/release
        ls release

log中,该发布位于/release/*

mkdir -p release

env GOOS=linux GOARCH=amd64 go build -o release/gagocli-vv0.6-linux-amd64 github.com/MarkEdmondson1234/gago/gagocli

env GOOS=darwin GOARCH=amd64 go build -o release/gagocli-vv0.6-darwin-amd64 github.com/MarkEdmondson1234/gago/gagocli

env GOOS=windows GOARCH=amd64 go build -o release/gagocli-vv0.6-windows-amd64.exe github.com/MarkEdmondson1234/gago/gagocli

echo Releases in /release

Releases in /release

ls release

gagocli-vv0.6-darwin-amd64

gagocli-vv0.6-linux-amd64

gagocli-vv0.6-windows-amd64.exe

(我也尝试过release/*),但是当我设置travis(包括解决其他问题的skip_cleanup: true)时,找不到文件:

Deploying to repo: MarkEdmondson1234/gago

Current tag is: v0.6

/release/* does not exist.

(与release/*相同的结果)

不过,这些文件是根据我在日志中看到的内容创建的。

我当前的travis-file:行是问题的根源:

before_deploy:
- make release
deploy:
  provider: releases
  skip_cleanup: true
  api_key:
    secure: FSk8DEG1vae8uUYaV+etc/umwescm0eV072jvTS6GarzlA=
  file: /release/*
  on:
    repo: MarkEdmondson1234/gago
    tags: true

有人可以帮助我帮助travis部署找到我的文件吗?

1 个答案:

答案 0 :(得分:0)

我认为这与glob有关,因为当我尝试使用显式文件时,它起作用了:

Makefile:

release:
        mkdir -p release
        env GOOS=linux GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-linux-amd64 $(BINARY_NAME_CLI)
        env GOOS=darwin GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-darwin-amd64 $(BINARY_NAME_CLI)
        env GOOS=windows GOARCH=amd64 $(GOBUILD) -o release/$(CLI)-$(VERSION)-windows-amd64.exe $(BINARY_NAME_CLI)
        ls release

Travis文件:

env:
  global:
    - GAGO_AUTH=${GOPATH}/auth.json
    - VERSION=${TRAVIS_TAG}
before_deploy:
- make release
deploy:
  provider: releases
  skip_cleanup: true
  api_key:
    secure: FSk8DEG1vae8uUYaV+XZtgXXqzikq3qEj7eSHOI540RpSISKSYjloAMB7RaAbZYfVR5JbEqNlb6JIzPYH3U4pYFKd55abWoEFjReKcyhZgJE7j7AzZr5kltKEp8Zp7OwcX5BWwx3lcol/v5Tq534+SdPUZbVosBMRWx6XmlLIrr6qBd5flUlrhbe9qNhskRmlVUZswJBeU1mJbT2wnmLgn2Rc+NBmYQhR1iU5WEnQGnq+ZcKyhDWa08yeXt/SBS69ItA5WonzSXRjgHutAX3dk3tqVRi9QmVKsTzHQDSeagc7jMbmzeEc+vGPg4Oqkqy0Bax/ElpyXEsTm4jeqDdx6BWf9ncjnRnkzDC1rqJHvO13LJX5Nkf2PjlfBIlzL+zo3zGZ18FwqL+NPxsxr5DPiFfqIi3ZDZLHh0TY8kIAr7K7+sKXGoZiXMGnds6O7duzdYzXMw5XHn9DpXalXcQ5sP0GjjUpwSiOlF8t++WpSJDfytxQPVt7f9wlEvWjIR6lBLNf5AluHWhcIH5K6Xr1RNjjJ+zB6JNRTgzJhjMuHaBqNbWgO7GXrM2gSonXwDeUCBV8jklVGJyhxAoBMzUznZlNor0d9gt/ZyFGhEKORgJMqBucQjSerlWsWTOwGQWQcOcfVkww3zJok61MB/umwescm0eV072jvTS6GarzlA=
  file: 
    - release/gagocli-${VERSION}-linux-amd64
    - release/gagocli-${VERSION}-darwin-amd64
    - release/gagocli-${VERSION}-windows-amd64.exe
  on:
    repo: MarkEdmondson1234/gago
    tags: true