我为一个带有 github 操作的项目配置了 CD,当它在 bash shell 中调用命令时发生了一个意外错误
dotnet publish --runtime win64 ...
MSBUILD : error MSB1008: Only one project can be specified.
Switch: p:DebugType=None
托管跑步者的有趣之处在于ubuntu-latest
它运行良好。
这个问题也有类似的问题,但我不知道如何将它与这个场景集成。
有什么想法吗?
感谢帮助
释放.yml
name: Publish
on:
release:
types: [published]
jobs:
release:
name: Release
strategy:
matrix:
kind: ["linux", "windows"]
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Cache Nuget
uses: actions/cache@v1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Publish
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="Test-$tag-${{ matrix.target }}"
dotnet publish Web/Web.csproj --configuration Release --runtime "${{ matrix.target }}" /p:DebugType=None /p:DebugSymbols=false --output "$release_name"
if [ "${{ matrix.target }}" == "win-x64" ]; then
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "Test*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}