Compare commits

...

2 Commits

3 changed files with 75 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ env:
jobs:
Build_Project_4-Series:
runs-on: windows-latest
steps:
steps:
- uses: actions/checkout@v3
- name: Set Version Number
id: setVersion
@@ -57,26 +57,28 @@ jobs:
$phase = 'beta'
$newVersionString = "{0}-{1}-{2}" -f $newVersion, $phase, $Env:GITHUB_RUN_NUMBER
}
}
echo "version=$newVersionString" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
}
echo "version=$newVersionString" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Setup MS Build
uses: microsoft/setup-msbuild@v1.1
- name: restore Nuget Packages
run: nuget restore .\$($Env:SOLUTION_FILE).sln
# Build the solutions in the docker image
- name: Build Solution
- name: Build Solution
run: msbuild .\$($Env:SOLUTION_FILE).sln /p:Platform="Any CPU" /p:Configuration="Debug" /p:Version="${{ steps.setVersion.outputs.version }}" -m
- name: Pack Solution
run: dotnet pack .\$($Env:SOLUTION_FILE).sln --configuration $env:BUILD_TYPE --output ./output /p:Version="${{ steps.setVersion.outputs.version }}"
- name: Create tag for non-rc builds
if: ${{ !contains(steps.setVersion.outputs.version, 'rc') }}
if: contains(steps.setVersion.outputs.version, 'alpha')
run: |
git tag ${{ steps.setVersion.outputs.version }}
git push --tags origin
# Create the release on the source repo
- name: Create Release
id: create_release
# if: contains(steps.setVersion.outputs.version,'-rc-') ||
# contains(steps.setVersion.outputs.version,'-hotfix-') ||
# contains(steps.setVersion.outputs.version, '-beta-')
uses: ncipollo/release-action@v1
with:
artifacts: 'output\**\*.*(cpz|cplz)'
@@ -84,11 +86,11 @@ jobs:
prerelease: ${{contains('debug', env.BUILD_TYPE)}}
tag: ${{ steps.setVersion.outputs.version }}
- name: Setup Nuget
run: |
run: |
nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username pepperdash -password ${{ secrets.GITHUB_TOKEN }}
nuget setApiKey ${{ secrets.GITHUB_TOKEN }} -Source github
nuget setApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
nuget setApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
- name: Publish to Nuget
run: nuget push .\output\*.nupkg -Source https://api.nuget.org/v3/index.json
- name: Publish to Github Nuget
run: nuget push .\output\*.nupkg -Source github
run: nuget push .\output\*.nupkg -Source github

View File

@@ -10,17 +10,72 @@
</None>
</ItemGroup>
<Target Name="Create CPLZ" AfterTargets="Build; AfterRebuild" Condition="$(ProjectType) == 'ProgramLibrary' And $(TargetDir) != ''">
<Message Text="Creating CPLZ $(TargetDir)"></Message>
<Message Text="Creating CPLZ $(TargetDir)" Importance="high" />
<Message Text="PackageOutputPath: $(PackageOutputPath)" Importance="high" />
<Message Text="AssemblyName: $(AssemblyName)" Importance="high" />
<Message Text="TargetName: $(TargetName)" Importance="high" />
<Message Text="Version: $(Version)" Importance="high" />
<Message Text="TargetFramework: $(TargetFramework)" Importance="high" />
<MakeDir Directories="$(PackageOutputPath)" Condition="!Exists($(PackageOutputPath))" />
<MakeDir Directories="$(PackageOutputPath)\$(AssemblyName)" Condition="!Exists('$(PackageOutputPath)\$(AssemblyName)')" />
<ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/>
</Target>
<Target Name="Copy CPZ NET6" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net6.0' ) Or ( '$(TargetFramework)' == 'net8.0' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
<Target Name="Debug Variables" BeforeTargets="Build">
<Message Text="================ Debug Variables ================" Importance="high" />
<Message Text="ProjectType: '$(ProjectType)'" Importance="high" />
<Message Text="TargetFramework: '$(TargetFramework)'" Importance="high" />
<Message Text="TargetDir: '$(TargetDir)'" Importance="high" />
<Message Text="===============================================" Importance="high" />
</Target>
<Target Name="Copy CPZ NET47" AfterTargets="SimplSharpPostProcess47" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' != 'net6.0' ) And ( '$(TargetFramework)' != 'net8.0' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
<Target Name="Copy CPZ NET6"
AfterTargets="Build"
DependsOnTargets="BuildDependencies"
Condition="'$(ProjectType)' == 'Program' And ('$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0')">
<Message Text="========================================" Importance="high" />
<Message Text="Starting CPZ Build Process" Importance="high" />
<Message Text="ProjectType: '$(ProjectType)'" Importance="high" />
<Message Text="TargetFramework: '$(TargetFramework)'" Importance="high" />
<Message Text="MSBuildProjectDirectory: '$(MSBuildProjectDirectory)'" Importance="high" />
<Message Text="PATH: '$(PATH)'" Importance="high" />
<Message Text="========================================" Importance="high" />
<!-- Check for SimplSharp compiler -->
<PropertyGroup>
<SimplSharpCompilerPath>$(HOME)/.crestron/SimplSharpPro/SimplSharpCompiler</SimplSharpCompilerPath>
</PropertyGroup>
<Warning Text="SimplSharpCompiler not found at: $(SimplSharpCompilerPath)"
Condition="!Exists('$(SimplSharpCompilerPath)')" />
<!-- Run the SimplSharp compiler to create CPZ -->
<Exec Command="&quot;$(SimplSharpCompilerPath)&quot; &quot;$(MSBuildProjectDirectory)&quot; &quot;$(TargetDir)&quot;"
IgnoreExitCode="false"
WorkingDirectory="$(MSBuildProjectDirectory)"
ConsoleToMSBuild="true"
Condition="Exists('$(SimplSharpCompilerPath)')">
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
</Exec>
<Message Text="SimplSharp Output: $(OutputOfExec)" Importance="high" />
<!-- Create output directory -->
<MakeDir Directories="$(PackageOutputPath)\$(AssemblyName)"
Condition="!Exists('$(PackageOutputPath)\$(AssemblyName)')" />
<!-- Copy the CPZ file -->
<Copy SourceFiles="$(TargetDir)$(TargetName).cpz"
DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz"
Condition="Exists('$(TargetDir)$(TargetName).cpz')" />
<Message Text="CPZ Build completed"
Condition="Exists('$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz')"
Importance="high" />
</Target>
</Project>
<Target Name="BuildDependencies">
<MSBuild Projects="@(ProjectReference)"
Targets="Build"
BuildInParallel="true" />
</Target>
</Project>

View File

@@ -6,7 +6,7 @@
<PropertyGroup>
<RootNamespace>PepperDash.Essentials</RootNamespace>
<AssemblyName>PepperDashEssentials</AssemblyName>
<TargetFrameworks>net472;net6</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Title>PepperDash Essentials</Title>