You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: .NET Core Desktopon:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
configuration: [Release]runs-on: windows-latest # For a list of available runner types, refer to# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-onenv:
Solution_Name: FocusStudy.sln # Replace with your solution name, i.e. MyWpfApp.sln.steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- name: Checkoutuses: actions/checkout@v3with:
fetch-depth: 0# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuilduses: microsoft/[email protected]# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the applicationrun: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configurationenv:
Configuration: ${{ matrix.configuration }}
- name: Build solutionrun: msbuild $env:Solution_Name /t:Build /p:Configuration=$env:Configuration
- name: Zip the Buildrun: zip -r release.zip /bin/$env:Configuration/
- uses: actions/upload-artifact@v3with:
name: build-artifactpath: ./release.zip
前言
github一直以来都是用来issue写博客和存一些个人以及练习代码的基本功能。对一些其他功能没怎么玩。正好最近在学一些关于CI/CD的知识。正好玩玩看github的Actions的功能,一边试水一边记录,希望这篇日志不是一篇“翻车”日志
使用Actions生成windows桌面程序
首先找一个桌面程序的repository,进入到到Actions
github很“智能”简易让我选".NET Desktop"
感觉和docker的配置文件有点像,看上去挺简洁的,但是显然还有一定的学习成本。
至少可以和怎么把大象放到冰箱里面类似。
说复杂也不复杂,所有的子步骤都是组件化,有一个专门的Marketplace,想要用就可以直接拿来用。
过程就不表了
完成后,Actions里面多了一个工作流,并且可以手工触发
翻了两次车
手动编译工作流配置
小目标完成,接下来把自动发布给做了吧
也没有太多的难度,把主要知识点梳理了下
可以把git的tag,push到本地后触发编译
使用create-releaseAction来生成新的release,其中releasenote可以动态指定路径“抓取”。
使用upload-release-assetAction来上传发布二进制文件,是和create-release上下文配套使用的
Compress-Archive文件还是要用
tag命令还是蛮好玩的,特别是删远端的tag,看StackOverflow是一个高访问的问题
发布工作流配置
相关链接
GitHub Actions 快速入门
关于工作流程
了解 GitHub Actions
Compress-Archive
How do I delete a remote tag?
The text was updated successfully, but these errors were encountered: