我有三个 Travis CI 工作来为不同的操作系统构建我的应用程序。
每个操作系统都有一个单独的工作:OS X 用于 osx-x64,Linux 用于 linux-x64,Windows 用于 win-x64。
构建后,我得到了我的应用程序的一个文件,它位于路径ImagePoster4DTF/ImagePoster4DTF/bin/Release/netcoreapp3.1/{win-x64,linux-x64,osx-x64}/publish/ImagePoster4DTF{.exe,}
.
如何将来自不同作业的三个文件上传到单个 GitHub 版本?
我当前的.travis.yml
文件不起作用:
language: csharp
mono: none
dotnet: 3.1.301
git:
depth: 2
quiet: true
symlinks: true
script:
- dotnet restore
jobs:
include:
- os: linux
script: dotnet publish -r linux-x64 --configuration Release -p:PublishSingleFile=true
- os: osx
script: dotnet publish -r osx-x64 --configuration Release -p:PublishSingleFile=true
- os: windows
script: dotnet publish -r win-x64 --configuration Release -p:PublishSingleFile=true
- stage: Publish GitHub release
before_deploy:
# Set up git user name and tag this commit
- git config --local user.name "Artoria Pendragon"
- git config --local user.email "saber-nyan@ya.ru"
- export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
- git tag $TRAVIS_TAG
deploy:
provider: releases
api_key:
secure: SOME_ENCRYPTED_KEY
file_glob: true
file: "ImagePoster4DTF/bin/Release/netcoreapp3.1/**/publish/*"
skip_cleanup: true