Skip to content
This repository was archived by the owner on Sep 14, 2025. It is now read-only.

Commit 2d42816

Browse files
authored
Create dotnet-desktop.yml
1 parent 2968df3 commit 2d42816

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow will build, test, sign and package a WPF or Windows Forms desktop application
7+
# built on .NET Core.
8+
# To learn how to migrate your existing application to .NET Core,
9+
# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
10+
#
11+
# To configure this workflow:
12+
#
13+
# 1. Configure environment variables
14+
# GitHub sets default environment variables for every workflow run.
15+
# Replace the variables relative to your project in the "env" section below.
16+
#
17+
# 2. Signing
18+
# Generate a signing certificate in the Windows Application
19+
# Packaging Project or add an existing signing certificate to the project.
20+
# Next, use PowerShell to encode the .pfx file using Base64 encoding
21+
# by running the following Powershell script to generate the output string:
22+
#
23+
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
24+
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
25+
#
26+
# Open the output file, SigningCertificate_Encoded.txt, and copy the
27+
# string inside. Then, add the string to the repo as a GitHub secret
28+
# and name it "Base64_Encoded_Pfx."
29+
# For more information on how to configure your signing certificate for
30+
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
31+
#
32+
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
33+
# See "Build the Windows Application Packaging project" below to see how the secret is used.
34+
#
35+
# For more information on GitHub Actions, refer to https://github.com/features/actions
36+
# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
37+
# refer to https://github.com/microsoft/github-actions-for-desktop-apps
38+
39+
name: .NET Core Desktop
40+
41+
on:
42+
push:
43+
branches: [ "master" ]
44+
pull_request:
45+
branches: [ "master" ]
46+
47+
jobs:
48+
49+
build:
50+
51+
strategy:
52+
matrix:
53+
configuration: [Debug, Release]
54+
55+
runs-on: windows-latest # For a list of available runner types, refer to
56+
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
57+
58+
env:
59+
Solution_Name: Haptics Presets OSC.sln # Replace with your solution name, i.e. MyWpfApp.sln.
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
with:
65+
fetch-depth: 0
66+
67+
# Install the .NET Core workload
68+
- name: Install .NET Core
69+
uses: actions/setup-dotnet@v4
70+
with:
71+
dotnet-version: 8.0.x
72+
73+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
74+
- name: Setup MSBuild.exe
75+
uses: microsoft/setup-msbuild@v2
76+
77+
# Execute all unit tests in the solution
78+
#- name: Execute unit tests
79+
# run: dotnet test
80+
81+
# Build the app
82+
- name: Publish
83+
run: dotnet publish "./Haptics Presets OSC/Haptics Presets OSC.csproj" -r win-x64 -o "./Haptics Presets OSC/bin/publish/win-x64/"
84+
85+
# Upload the EXE https://github.com/marketplace/actions/upload-a-build-artifact
86+
- name: Upload build artifacts
87+
uses: actions/upload-artifact@v3
88+
with:
89+
name: Executable
90+
path: "Haptics Presets OSC/bin/publish/win-x64/Haptics Presets OSC.exe"

0 commit comments

Comments
 (0)