Skip to content

.NET - Publish

.NET - Publish #5

Workflow file for this run

name: .NET - Publish
on:
push:
tags:
- 'v*.*'
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore dependencies
run: nuget restore SourceUtils.sln
- name: Build
run: msbuild SourceUtils.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU" /verbosity:minimal
- name: Create Publish Directory
run: |
New-Item -Path . -Name "Publish" -ItemType "Directory"
New-Item -Path "Publish" -Name "bin" -ItemType "Directory"
Copy-Item "README.md" -Destination "Publish"
Copy-Item "Examples/*" -Destination "Publish" -Recurse
Copy-Item "SourceUtils.WebExport/bin/Release/*" -Destination "Publish/bin" -Recurse
Compress-Archive -Path "Publish/*" -DestinationPath "SourceUtils.zip"
shell: pwsh
- name: Upload Release
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: softprops/action-gh-release@v1
with:
files: 'SourceUtils.zip'
- name: Upload Artifacts
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
with:
path: 'SourceUtils.zip'