Skip to content

Commit

Permalink
Merge pull request #25 from BoredTweak/dotnet5
Browse files Browse the repository at this point in the history
Implementing a CI Pipeline and enabling development via the .NET CLI
  • Loading branch information
shanselman committed Mar 26, 2021
2 parents c165c07 + 43a6f4a commit 8208774
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 77 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Continuous Integration Pipeline

on: [push, pull_request]

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
dotnet: [ '5.0.x' ]
runtime: [ 'win-x64', 'win-x86' ]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Publish
run: dotnet publish --configuration Release --runtime ${{ matrix.runtime }} --output ./publish -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true -p:DebugType=None

- name: Upload Build Artifacts
uses: actions/upload-artifact@v2
with:
name: BabySmash-${{ matrix.runtime }}-${{ matrix.dotnet }}
path: ./publish
if-no-files-found: error
45 changes: 2 additions & 43 deletions BabySmash.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
<OutputType>WinExe</OutputType>
<ManifestCertificateThumbprint>E4355A6B46BE61300D217B56C346651E03BEB47F</ManifestCertificateThumbprint>
<ManifestKeyFile>private.pfx</ManifestKeyFile>
<GenerateManifests>true</GenerateManifests>
<SignManifests>false</SignManifests>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ApplicationIcon>App.ico</ApplicationIcon>
<PublishUrl>C:\Users\Scott\Desktop\babysmashWithEric\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
Expand All @@ -22,25 +20,18 @@
<SupportUrl>http://feedback.babysmash.com</SupportUrl>
<ProductName>BabySmash!</ProductName>
<PublisherName>BabySmash</PublisherName>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>99</ApplicationRevision>
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Update="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Update="System.Core"/>
<Reference Include="System.Speech" />
<Reference Update="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Update="System.Xml.Linq"/>
</ItemGroup>
<ItemGroup>
<None Include="private.pfx" />
Expand All @@ -56,38 +47,6 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
<Visible>False</Visible>
<ProductName>Windows Installer 4.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Sounds\babylaugh.wav" />
<EmbeddedResource Include="Resources\Sounds\giggle.wav" />
Expand Down
1 change: 0 additions & 1 deletion Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public void Launch()
Win32Audio.PlayWavResourceYield("EditedJackPlaysBabySmash.wav");

string[] args = Environment.GetCommandLineArgs();
string ext = System.IO.Path.GetExtension(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);

#if !false
timer.Start();
Expand Down
32 changes: 0 additions & 32 deletions Properties/AssemblyInfo.cs

This file was deleted.

41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
BabySmash
=========

- [Overview](#overview)
- [Enhancements](#enhancements)
- [AutoHotkey](#autohotkey)
- [Local Development](#local-development)
- [Prerequisites](#prerequisites)
- [Compile](#compile)
- [Debug](#debug)
- [Publish](#publish)
- [Custom Words](#custom-words)

## Overview
The BabySmash game for small kids.

Expand Down Expand Up @@ -29,3 +39,34 @@ Used in conjunction with a tool like AutoHotkey, you can essentially create a "b
* Try out your new hotkey to make sure it works. If not, go back to 'Edit This Script' and try again.

For more advanced customization, see also: http://ahkscript.org/docs/Tutorial.htm

## Local Development

### Prerequisites

- [.NET 5.0](https://dotnet.microsoft.com/download/dotnet/5.0)

### Compile

The BabySmash solution can be built by running the .NET CLI command ```dotnet build``` in the root directory or alternatively via Visual Studio.

### Debug

Developers can run the BabySmash code by running the .NET CLI command ```dotnet run``` in the root directory or alternatively via Visual Studio.

### Publish

Build artifacts are included in the [```Continuous Integration Pipeline``` GitHub Action](./.github/workflows/ci.yml). View the summary of a successful build in order to retrieve uploaded artifacts.

In order to run a local publish run the following command from the root directory
```
dotnet publish --configuration Release --runtime ${{ matrix.runtime }} --output ./publish -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true
```

If you encounter issues in a locally published BabySmash executable, there are logs published to the Windows Event Viewer under Windows Logs > Application.

## Custom Words

Along with any deployment of BabySmash.exe is a [```Words.txt``` file](./Words.txt). This file determines what combination of letters is constructed into words for the application smasher. Simply adjust the file by adding words on new lines to add to the library.

There are additionally custom regional definitions in [./Resources/Strings/](./Resources/Strings/) which may be contributed to to adjust the words used for speaking shape and color names.
2 changes: 1 addition & 1 deletion WordFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class WordFinder
public WordFinder(string wordsFilePath)
{
// File path provided should be relative to our running location, so combine for full path safety.
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string dir = Path.GetDirectoryName(AppContext.BaseDirectory);
wordsFilePath = Path.Combine(dir, wordsFilePath);

// Bail if the source word file is not found.
Expand Down
1 change: 1 addition & 0 deletions Words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ AGAIN
AGAINST
AGO
AIDEN
AIMEE
AIR
AIRED
AIRING
Expand Down

0 comments on commit 8208774

Please sign in to comment.