Skip to content

更新action

更新action #10

Workflow file for this run

name: .NET Core Desktop
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-latest
name: Dotnet Build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Clean HTMLToDocX
run: dotnet clean HTMLToDocX/HTMLToDocX.csproj --configuration Release && dotnet nuget locals all --clear
- name: Restore dependencies for HTMLToDocX
run: dotnet restore HTMLToDocX/HTMLToDocX.csproj
- name: Build HTMLToDocX
run: dotnet build HTMLToDocX/HTMLToDocX.csproj --no-restore --configuration Release
- name: Set Version
run: powershell -Command "(gc $env:GITHUB_WORKSPACE\HTMLToDocX\Utils\ActionVersion.cs) -replace '{VERSION}', '$env:GITHUB_REF_NAME' | Out-File $env:GITHUB_WORKSPACE\HTMLToDocX\Utils\ActionVersion.cs"
- name: Set Build
run: powershell -Command "(gc $env:GITHUB_WORKSPACE\HTMLToDocX\Utils\ActionVersion.cs) -replace '{BUILD}', '$env:GITHUB_RUN_NUMBER' | Out-File $env:GITHUB_WORKSPACE\HTMLToDocX\Utils\ActionVersion.cs"
- name: Publish HTMLToDocX
run: dotnet publish HTMLToDocX/HTMLToDocX.csproj -c Release -r win-x64 --no-restore
- run: powershell curl https://github.com/aiqinxuancai/DotNetDllPathPatcherWPF/releases/download/v0.0.15/DotNetDllPathPatcherCMD.zip -o DotNetDllPathPatcherCMD.zip
- run: powershell Expand-Archive -Path .\DotNetDllPathPatcherCMD.zip -DestinationPath .\DotNetDllPathPatcherCMD
- run: powershell .\DotNetDllPathPatcherCMD\publish\DotNetDllPathPatcherCMD.exe $env:GITHUB_WORKSPACE\HTMLToDocX\bin\Release\net8.0-windows\win-x64\publish\HTMLToDocX.exe
- name: Compress
run: powershell Compress-Archive -Path $env:GITHUB_WORKSPACE\HTMLToDocX\bin\Release\net8.0-windows\win-x64\publish -DestinationPath .\HTMLToDocX.zip
- name: Create a Release
uses: ncipollo/release-action@v1
with:
artifacts: "HTMLToDocX.zip"
token: ${{ secrets.GITHUB_TOKEN }}