fetch 0 #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file | |
name: 'Deploy Nugets' | |
on: | |
push: | |
branches: | |
- stable | |
env: | |
solution: 'MinoriEditorShell.sln' | |
buildPlatform: Any CPU | |
buildConfiguration: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: 'Checkout Sources' | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: 'Setup msbuild' | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0.9.7 | |
with: | |
versionSpec: 5.x | |
- name: Setup NuGet | |
uses: nuget/setup-nuget@v1 | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v0.9.7 | |
- run: nuget restore ${{env.solution}} | |
- run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}' | |
- name: Create Artifacts | |
run: | | |
# Get list of all nupkgs | |
$nupkgs = Get-ChildItem -Path .\Modules -Filter *.nupkg -Recurse | |
$basedir = 'MinoriEditorSystem-' + $env:GitVersion_NuGetVersion | |
# Move each item into artifacts | |
# rm Artifacts -Recurse -Force | |
mkdir Artifacts\$basedir\Nugets | |
# Copy nugets to nuget folder | |
foreach ($nupkg in $nupkgs) { | |
$leaf = Split-Path $nupkg -Leaf | |
$outFile = "Artifacts\$basedir\Nugets\$leaf" | |
echo $nupkg.FullName ' -> ' $outFile | |
Copy-Item $nupkg.FullName $outFile | |
} | |
# Copy Demo Folder | |
#mkdir Artifacts\$basedir\Demos | |
cp Demos\SimpleDemo\SimpleDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.WPF -Recurse | |
cp Demos\SimpleDemo\SimpleDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.RibbonWPF -Recurse | |
cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse | |
cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse | |
# Compress folder into 7z file | |
cd Artifacts | |
7z a "$basedir.7z" $basedir | |
cd .. | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: MinoriEditorShell | |
path: Artifacts/*.7z | |
if-no-files-found: error | |