我不想让.Net核心应用在GitHub Repos中自动构建,并将构建的二进制压缩到新版本,但我不想在GitHub up上设置它。例如,我有我的.Net核心控制台应用程序,并将我的分支拖入到主程序中。现在构建应该开始了(这就是我所拥有的),在构建之后,二进制文件应该被压缩并附加到新的版本中,所以将会有持续不断的新版本。
希望有人能理解并能帮上忙。
这是我到目前为止的工作流程
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore发布于 2020-04-26 02:56:16
多亏了Deepak Mishra,我现在已经解决了这个问题
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Zip the Build
run: zip -r ${{ secrets.ReleaseZipName }} ./AppName/bin/Release/netcoreapp3.1/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.ref }}
body: New Release.
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./${{ secrets.ReleaseZipName }}.zip
asset_name: ${{ secrets.ReleaseZipName }}.zip
asset_content_type: application/ziphttps://stackoverflow.com/questions/61424387
复制相似问题