Skip to content

Commit

Permalink
Updated CD pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
space928 committed Feb 17, 2024
1 parent cce8ef3 commit bcd83c6
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 49 deletions.
57 changes: 8 additions & 49 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
# built on .NET Core.
# To learn how to migrate your existing application to .NET Core,
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
#
# To configure this workflow:
#
# 1. Configure environment variables
# GitHub sets default environment variables for every workflow run.
# Replace the variables relative to your project in the "env" section below.
#
# 2. Signing
# Generate a signing certificate in the Windows Application
# Packaging Project or add an existing signing certificate to the project.
# Next, use PowerShell to encode the .pfx file using Base64 encoding
# by running the following Powershell script to generate the output string:
#
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
#
# Open the output file, SigningCertificate_Encoded.txt, and copy the
# string inside. Then, add the string to the repo as a GitHub secret
# and name it "Base64_Encoded_Pfx."
# For more information on how to configure your signing certificate for
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
#
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
# See "Build the Windows Application Packaging project" below to see how the secret is used.
#
# For more information on GitHub Actions, refer to https://github.com/features/actions
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
# refer to https://github.com/microsoft/github-actions-for-desktop-apps

name: .NET Core Desktop

on:
Expand All @@ -50,16 +12,15 @@ jobs:

strategy:
matrix:
configuration: [Debug, Release]
configuration: [Release]

runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on

env:
Solution_Name: QPlayer # Replace with your solution name, i.e. MyWpfApp.sln.
# Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: QPlayer # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: QPlayer.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
Project_Directory: QPlayer # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Project_Path: QPlayer/QPlayer.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.

steps:
- name: Checkout
Expand Down Expand Up @@ -96,20 +57,18 @@ jobs:
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
run: msbuild $env:Project_Path /p:Configuration=$env:Configuration /p:PublishProfile=$env:PublishProfileDir /p:PublishDir="../publish/" /target:publish /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64
Appx_Package_Build_Mode: StoreUpload
PublishProfileDir: "/QPlayer/Properties/PublishProfiles/ClickOnceProfile.pubxml"
Configuration: ${{ matrix.configuration }}

# Remove the pfx
- name: Remove the pfx
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
run: Remove-Item -path $env:Project_Directory\GitHubActionsWorkflow.pfx

# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
# Upload the build artifacts
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: MSIX Package
path: ${{ env.Wap_Project_Directory }}\AppPackages
path: ${{ env.Project_Directory }}\publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.user
*.pfx
SigningCertificate_Encoded.txt
**/publish
24 changes: 24 additions & 0 deletions QPlayer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,37 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|ARM.ActiveCfg = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|ARM.Build.0 = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|ARM64.Build.0 = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|x64.ActiveCfg = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|x64.Build.0 = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|x86.ActiveCfg = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Debug|x86.Build.0 = Debug|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|Any CPU.Build.0 = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|ARM.ActiveCfg = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|ARM.Build.0 = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|ARM64.ActiveCfg = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|ARM64.Build.0 = Release|Any CPU
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|x64.ActiveCfg = Release|x64
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|x64.Build.0 = Release|x64
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|x86.ActiveCfg = Release|x86
{AC3A2BB3-F46C-45D0-986F-D28AC74A8649}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
46 changes: 46 additions & 0 deletions QPlayer/Properties/PublishProfiles/ClickOnceProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.1.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
<CreateWebPageOnPublish>False</CreateWebPageOnPublish>
<GenerateManifests>true</GenerateManifests>
<Install>True</Install>
<InstallFrom>Disk</InstallFrom>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>False</IsWebBootstrapper>
<ManifestCertificateThumbprint>256BA6FA05B0E90D8F154AE963662DA87EAC102C</ManifestCertificateThumbprint>
<MapFileExtensions>True</MapFileExtensions>
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
<Platform>Any CPU</Platform>
<ProductName>QPlayer</ProductName>
<PublishDir>bin\Release\net7.0-windows\app.publish\</PublishDir>
<PublishUrl>..\publish\</PublishUrl>
<PublisherName>Thomas Mathieson</PublisherName>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
<SelfContained>False</SelfContained>
<SignatureAlgorithm>sha256RSA</SignatureAlgorithm>
<SignManifests>True</SignManifests>
<SkipPublishVerification>false</SkipPublishVerification>
<SupportUrl>https://github.com/space928/QPlayer/issues</SupportUrl>
<TargetFramework>net7.0-windows</TargetFramework>
<UpdateEnabled>False</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.7.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 7.0.16 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions QPlayer/QPlayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/space928/QPlayer</RepositoryUrl>
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
<ApplicationIcon>Resources\Icon.ico</ApplicationIcon>
<Platforms>AnyCPU;x86;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit bcd83c6

Please sign in to comment.