在GitHub上自动发布.Net Core应用

编程入门 行业动态 更新时间:2024-10-25 23:26:53
本文介绍了在GitHub上自动发布.Net Core应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我不想在自动生成的GitHub Repos中制作.Net Core App,并将构建的二进制文件推送到新的Release,但是我不知道在GitHub上进行设置.因此,例如,我有我的.Net Core Console应用程序,并将更改后的分支拉到master中.现在,应该在压缩二进制文件并将其附加到新发行版之后开始构建(就是我所拥有的).因此,将会有连续不断的新发行版.

I wan't to make .Net Core App in a GitHub Repos that builds automized and pushes the binaries of the build zipped to a new Release, but I have no idea to set this on GitHub up. So for example I have my .Net Core Console Application and pull my branch with changes into master. Now the build should start(thats what I have) after the build the binaries should be zipped and attached to a new Release, so there would be continious new Releases.

希望有人能理解并能提供帮助.

Hopefully someone understand and can Help.

这是我到目前为止的工作流程

Here is my workflow till now

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

推荐答案

感谢Deepak Mishra,我现在已经通过这种方式解决了

I have now solved this way thanks to 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: 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/zip

更多推荐

在GitHub上自动发布.Net Core应用

本文发布于:2023-11-15 23:18:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:GitHub   Net   Core

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!