Skip to content

Commit 98a8017

Browse files
author
Joshua Hegedus
committed
Fixed readline
1 parent 2e4a903 commit 98a8017

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+867
-588
lines changed

.github/tags.yml.bak

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
- name: Get Build Version
2+
run: |
3+
Get-ChildItem
4+
Import-Module .\Solution\Tools\GetBuildVersion.psm1
5+
$version_text = $(git log -1 --no-merges --pretty='format:%C(auto)%s')
6+
Write-Host $version_text
7+
$version = GetBuildVersion -VersionString $version_text
8+
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
9+
shell: pwsh
10+
11+
# name: "Deploy to NuGet"
12+
13+
# on:
14+
# push:
15+
# tags:
16+
# - 'v*'
17+
18+
# env:
19+
# PROJECT_PATH: 'PasswordBoxMVVM/PasswordBoxMVVM.csproj'
20+
# PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
21+
# NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
22+
23+
# jobs:
24+
# deploy:
25+
# name: 'Deploy'
26+
# runs-on: 'windows-latest'
27+
# steps:
28+
# - name: 'Checkout'
29+
# uses: actions/checkout@v2
30+
31+
# - name: 'Install dotnet'
32+
# uses: actions/setup-dotnet@v1
33+
# with:
34+
# dotnet-version: '3.1.x'
35+
36+
# - name: 'Restore packages'
37+
# run: dotnet restore ${{ env.PROJECT_PATH }}
38+
39+
# - name: 'Build project'
40+
# run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
41+
42+
# - name: 'Get Version'
43+
# id: version
44+
# uses: battila7/get-version-action@v2
45+
46+
# - name: 'Pack project'
47+
# run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
48+
49+
# - name: 'Push package'
50+
# run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}

.github/workflows/modules-cicd.yml

Lines changed: 81 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,107 @@
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
1+
name: CI-CD
402

413
on:
424
push:
43-
branches: [ "master" ]
44-
pull_request:
45-
branches: [ "master" ]
46-
5+
tags:
6+
- 'v*'
7+
478
jobs:
48-
499
build:
10+
name: 'Build'
11+
env:
12+
BUILD_CONFIG: 'Release'
13+
SOLUTION: 'Solution/Modules.sln'
5014

51-
strategy:
52-
matrix:
53-
configuration: [Release]
15+
runs-on: windows-latest
5416

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
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
5722

23+
- name: Install .NET Core
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: 5.0.x
27+
28+
- name: Setup MSBuild.exe
29+
uses: microsoft/[email protected]
30+
31+
- name: Restore dependencies
32+
run: nuget restore $env:SOLUTION
33+
34+
- name: Build
35+
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG --no-restore
36+
test:
37+
name: 'Test'
38+
needs:
39+
- build
5840
env:
59-
Solution_Name: Modules\Modules.sln # Replace with your solution name, i.e. MyWpfApp.sln.
60-
Test_Project_Path: Modules\ImplementationTest\ImplementationTest.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
61-
# Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
62-
# Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
41+
BUILD_CONFIG: 'Release'
42+
SOLUTION: 'Solution/Modules.sln'
43+
44+
runs-on: windows-latest
6345

6446
steps:
6547
- name: Checkout
6648
uses: actions/checkout@v3
6749
with:
6850
fetch-depth: 0
6951

70-
# Install the .NET Core workload
7152
- name: Install .NET Core
7253
uses: actions/setup-dotnet@v3
7354
with:
74-
dotnet-version: 7.0.5
55+
dotnet-version: 5.0.x
7556

76-
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
7757
- name: Setup MSBuild.exe
7858
uses: microsoft/[email protected]
7959

80-
# Execute all unit tests in the solution
81-
- name: Execute unit tests
82-
run: dotnet test
60+
- name: Restore dependencies
61+
run: nuget restore $env:SOLUTION
8362

84-
# Restore the application to populate the obj folder with RuntimeIdentifiers
85-
- name: Restore the application
86-
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
87-
env:
88-
Configuration: ${{ matrix.configuration }}
63+
- name: Build
64+
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG --no-restore
8965

90-
# Decode the base 64 encoded pfx and save the Signing_Certificate
91-
- name: Decode the pfx
92-
run: |
93-
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
94-
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
95-
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
96-
97-
# Create the app package by building and packaging the Windows Application Packaging project
98-
# - name: Create the app package
99-
# 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 }}
100-
# env:
101-
# Appx_Bundle: Always
102-
# Appx_Bundle_Platforms: x86|x64
103-
# Appx_Package_Build_Mode: StoreUpload
104-
# Configuration: ${{ matrix.configuration }}
105-
106-
# Remove the pfx
107-
- name: Remove the pfx
108-
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
109-
110-
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
111-
- name: Upload build artifacts
112-
uses: actions/upload-artifact@v3
66+
- name: Run tests
67+
run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal
68+
deploy:
69+
name: 'Deploy'
70+
needs: [build, test]
71+
env:
72+
BUILD_CONFIG: 'Publish'
73+
SOLUTION: './Solution/Modules.sln'
74+
75+
runs-on: windows-latest
76+
77+
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v3
80+
with:
81+
fetch-depth: 0
82+
83+
- name: 'Get Version'
84+
id: get_version
85+
uses: battila7/get-version-action@v2
86+
87+
- name: Install .NET Core
88+
uses: actions/setup-dotnet@v3
11389
with:
114-
name: MSIX Package
115-
path: ${{ env.Wap_Project_Directory }}\AppPackages
90+
dotnet-version: 5.0.x
91+
92+
- name: Setup MSBuild.exe
93+
uses: microsoft/[email protected]
94+
95+
- name: Restore dependencies
96+
run: nuget restore $env:SOLUTION
97+
98+
- name: Build
99+
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG -p:PackageVersion=${{ steps.get_version.outputs.version-without-v }} --no-restore
100+
101+
- name: Run tests
102+
run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal
103+
104+
- name: Publish
105+
run: |
106+
dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
107+
dotnet nuget push **\*.nupkg --source 'https://nuget.pkg.github.com/joshika39/index.json' --api-key ${{secrets.GIT_API_KEY}}

ColorGenerator/ColorGenerator.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

Modules/Implementation/Core/Bootsrapper.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)