Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a temporary dev workflow to test dev builds during initial single-project msix transition
- Loading branch information
1 parent
86004b1
commit f8071f8
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# If you are looking for guidance for your builds, see https://github.com/microsoft/github-actions-for-desktop-apps | ||
name: Development | ||
|
||
on: | ||
push: | ||
branches: | ||
- main-dev | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2022 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Create my own version number with a specific format using date. ex: 2020.805.1.0 | ||
- uses: Amadevus/pwsh-script@v2 | ||
id: version-creator | ||
with: | ||
script: | | ||
$buildDay = Get-Date -Format "yyyy.Mdd" | ||
$ver = $buildDay + "." + $env:GITHUB_RUN_NUMBER + ".0" | ||
Set-ActionVariable APP_VERSION $ver | ||
# Update the UWP package version | ||
- name: Update manifest version | ||
run: | | ||
[xml]$manifest = get-content "src\MediaFileManager\PackageProject\Package.appxmanifest" | ||
$manifest.Package.Identity.Version = "$env:APP_VERSION" | ||
$manifest.save("src\MediaFileManager\PackageProject\Package.appxmanifest") | ||
# Updates the WPF project's assembly version number. | ||
- name: Update WPF Assembly version | ||
run: | | ||
function SetAssemblyFileVersion([string]$pathToFile, [string]$newVersion) { | ||
$newFile = Get-Content $pathToFile -encoding "UTF8" | foreach-object { | ||
if ($_.StartsWith("[assembly: AssemblyFileVersion")) { | ||
$verStart = $_.IndexOf("(") | ||
$verEnd = $_.IndexOf(")", $verStart) | ||
$origVersion = $_.SubString($verStart+2, $verEnd-$verStart-3) | ||
$newVersion = "$env:APP_VERSION" | ||
write-host "Setting AssemblyFileVersion from $origVersion to $newVersion" | ||
$_.Replace($origVersion, $newVersion) | ||
} else { | ||
$_ | ||
} | ||
} | ||
$newfile | Set-Content $assemblyInfoPath -encoding "UTF8" | ||
} | ||
$assemblyInfoPath = "src\MediaFileManager\MediaFileManager.Desktop\Properties\AssemblyInfo.cs" | ||
SetAssemblyFileVersion $assemblyInfoPath $env:APP_VERSION | ||
# Install the .NET Core workload | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0' | ||
|
||
# Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/setup-msbuild@v1.1 | ||
with: | ||
vs-version: '[16.10, 17.0)' | ||
|
||
# Use dotnet restore command for the solution (see RIDs https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) | ||
- name: DotNet Restore | ||
run: dotnet restore $env:SolutionPath --configfile $env:NugetConfigPath --runtime $env:RID | ||
env: | ||
TELERIK_USERNAME: ${{ secrets.TELERIK_USERNAME }} | ||
TELERIK_PASSWORD: ${{ secrets.TELERIK_PASSWORD }} | ||
SolutionPath: src\MediaFileManager\MediaFileManager.sln | ||
NugetConfigPath: src\nuget.config | ||
RID: win-x86 | ||
|
||
# In order to generate project.assets.json, we need to use nuget.exe for the wapproject | ||
- name: NuGet Restore Wapp Project (to ensure assets.json is available) | ||
run: nuget restore $env:WappProject_Path -ConfigFile $env:NuGetConfig_Path | ||
env: | ||
NuGetConfig_Path: src\nuget.config | ||
TELERIK_USERNAME: ${{ secrets.TELERIK_USERNAME }} | ||
TELERIK_PASSWORD: ${{ secrets.TELERIK_PASSWORD }} | ||
WappProject_Path: src\MediaFileManager\PackageProject\PackageProject.wapproj | ||
|
||
# Single project MSIX can build and product MSIX package the WPF at the same (see RIDs https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) | ||
- name: Build the Wpf application to populate the obj folder | ||
run: msbuild $env:WpfProjectPath /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RID /p:Platform=$env:TargetPlatform /p:UapAppxPackageBuildMode=$env:BuildMode /p:AppxBundle=$env:AppxBundle /p:AppxPackageSigningEnabled=$env:AppxPackageSigningEnabled | ||
env: | ||
TELERIK_USERNAME: ${{ secrets.TELERIK_USERNAME }} | ||
TELERIK_PASSWORD: ${{ secrets.TELERIK_PASSWORD }} | ||
WpfProjectPath: src\MediaFileManager\MediaFileManager.Desktop\MediaFileManager.Desktop.csproj | ||
Configuration: Debug | ||
RID: win-x86 | ||
TargetPlatform: x86 | ||
BuildMode: CI | ||
AppxBundle: Never | ||
AppxPackageSigningEnabled: False |