Skip to content

Commit

Permalink
add publish script and publish 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Apr 26, 2023
1 parent 0426ff4 commit 675c52f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
- name: Restore dependencies
Expand Down
64 changes: 64 additions & 0 deletions publish.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@echo off
SETLOCAL EnableDelayedExpansion
cd %~dp0
SET ROOT=%~dp0
set ZIPFILE=%ROOT%publish\XmlDiff.zip
for /f "usebackq" %%i in (%ROOT%src\Common\version.txt) do (
set VERSION=%%i
)

if "%VERSION%" == "" goto :noversion

echo ### Publishing version %VERSION% ...
set GITRELEASE=1

:parse
if "%1"=="/norelease" set GITRELEASE=0
if "%1"=="" goto :done
shift
goto :parse

:done

git clean -dfx
pwsh -f %ROOT%src\Common\fix_version.ps1

nuget restore src\XmlDiff.sln
if ERRORLEVEL 1 goto :norestore
msbuild /target:rebuild src\XmlDiff.sln /p:Configuration=Release "/p:Platform=Any CPU"
if ERRORLEVEL 1 goto :buildfailed

pwsh -f %ROOT%src\Common\full_sign.ps1
if ERRORLEVEL 1 goto :err_sign

nuget pack src\XmlDiffView\XmlDiff.nuspec

if exist publish rd /s /q publish
mkdir publish
pwsh -command "Compress-Archive -Path src\XmlDiffView\bin\Release\* -DestinationPath %ZIPFILE%"
if ERRORLEVEL 1 goto :err_compress

if "%GITRELEASE%" == "0" goto :finished

echo Creating new release for version %VERSION%
gh release create %VERSION% "LovettSoftware.XmlDiff.%VERSION%.nupkg" "%ZIPFILE%" --title "Xml Diff %VERSION%"

:finished
call gitweb
goto :eof

:norestore
echo Error restoring XmlDiff.sln
exit /b 1

:buildfailed
echo Error building XmlDiff.sln
exit /b 1

:err_sign
echo Signing failed, try building inside XmlNotepadSetup.sln
exit /b 1

:err_compress
echo Error creating zip file
exit /b 1
6 changes: 3 additions & 3 deletions src/Common/version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<Company>Lovett Software</Company>
<Copyright>Copyright © Lovett Software</Copyright>
<FileVersion>1.0.6</FileVersion>
<AssemblyVersion>1.0.6</AssemblyVersion>
<Version>1.0.6</Version>
<FileVersion>1.0.7</FileVersion>
<AssemblyVersion>1.0.7</AssemblyVersion>
<Version>1.0.7</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Common/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.5
1.0.7
2 changes: 1 addition & 1 deletion src/XmlDiffView/XmlDiff.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>LovettSoftware.XmlDiff</id>
<version>1.0.6</version>
<version>1.0.7</version>
<authors>Chris Lovett</authors>
<description>A library that compares and merges XML files.</description>
<projectUrl>https://github.com/lovettchris/xmldiff</projectUrl>
Expand Down
29 changes: 0 additions & 29 deletions src/t.htm

This file was deleted.

0 comments on commit 675c52f

Please sign in to comment.