Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/continuous integration #50

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build Audio Switcher

on: [push]

jobs:
build:

runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.2.x'

- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]

- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
version: ${{ steps.gitversion.outputs.NuGetVersionV2 }}
assemblyVersion: ${{ steps.gitversion.outputs.AssemblySemVer }}
fileVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }}
informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }}

- name: Setup MSBuild Path
uses: warrenbuckley/Setup-MSBuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Restore NuGet Packages
run: nuget restore src\AudioSwitcher.sln

- name: Build and Publish Application
run: msbuild src\AudioSwitcher.sln /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=src\AudioSwitcher\Properties\PublishProfiles\FolderProfile.pubxml

- name: Upload Artifact
uses: actions/[email protected]
with:
name: AudioSwitcher-${{ steps.gitversion.outputs.NuGetVersionV2 }}
path: src\AudioSwitcher\bin\Release\net48\win7-x86\

- name: Create release package
uses: papeloto/action-zip@v1
with:
files: src\AudioSwitcher\bin\Release\net48\win7-x86\
dest: publish\AudioSwitcher-${{ steps.gitversion.outputs.NuGetVersionV2 }}.zip

- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.gitversion.outputs.NuGetVersionV2 }}
release_name: Release ${{ steps.gitversion.outputs.NuGetVersionV2 }}
draft: false
prerelease: ${{ contains(steps.gitversion.outputs.NuGetVersionV2, 'beta') }}
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')

- name: Upload Release Asset
id: upload-release-asset-package
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: publish\AudioSwitcher-${{ steps.gitversion.outputs.NuGetVersionV2 }}.zip
asset_name: AudioSwitcher-${{ steps.gitversion.outputs.NuGetVersionV2 }}.zip
asset_content_type: application/zip
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')

6 changes: 6 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mode: ContinuousDeployment
branches:
master:
tag: beta
hotfix:
tag: useBranchName
16 changes: 13 additions & 3 deletions src/AudioSwitcher.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28001.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29920.165
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudioSwitcher", "AudioSwitcher\AudioSwitcher.csproj", "{8F82476F-30DC-47A5-80A0-AB8437E4EEA5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioSwitcher", "AudioSwitcher\AudioSwitcher.csproj", "{8F82476F-30DC-47A5-80A0-AB8437E4EEA5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{17ACB22F-55C7-4FF0-B8C3-5F302DE00F74}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{FEFE24F0-AB10-4913-AFDF-4D1A2E385A54}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{4BB0FF99-ED6B-48BE-A99E-8EE34109299B}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -24,6 +31,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4BB0FF99-ED6B-48BE-A99E-8EE34109299B} = {FEFE24F0-AB10-4913-AFDF-4D1A2E385A54}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {660A6FA6-A8A1-4B5C-8B65-4E9C113CD6B8}
EndGlobalSection
Expand Down
182 changes: 18 additions & 164 deletions src/AudioSwitcher/AudioSwitcher.csproj
Original file line number Diff line number Diff line change
@@ -1,41 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8F82476F-30DC-47A5-80A0-AB8437E4EEA5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AudioSwitcher</RootNamespace>
<AssemblyName>AudioSwitcher</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFramework>net48</TargetFramework>
<AssemblyTitle>AudioSwitcher</AssemblyTitle>
<Product>AudioSwitcher</Product>
<NeutralLanguage>en</NeutralLanguage>
<Copyright>Copyright (c) David Kean</Copyright>
<AssemblyVersion>0.1.0.0</AssemblyVersion>
<FileVersion>0.1.0.0</FileVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<StartupObject>AudioSwitcher.Program</StartupObject>
Expand All @@ -47,157 +29,31 @@
<ApplicationManifest>Properties\App.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationModel\StartupServiceAttribute.cs" />
<Compile Include="Audio\Interop\MMAudio\IPolicyConfig2.cs" />
<Compile Include="ComponentModel\ILifetime`2.cs" />
<Compile Include="ComponentModel\ILifetime.cs" />
<Compile Include="ComponentModel\IPriorityMetadata.cs" />
<Compile Include="IO\StreamExtensions.cs" />
<Compile Include="Presentation\IPresenter.cs" />
<Compile Include="Presentation\NonModalPresenter.cs" />
<Compile Include="Presentation\PresenterAttribute.cs" />
<Compile Include="Presentation\ContextMenuPresenter.cs" />
<Compile Include="Presentation\Presenter.cs" />
<Compile Include="Presentation\PresenterHost.PresenterLifetime.cs" />
<Compile Include="Presentation\PresenterHost.cs" />
<Compile Include="Presentation\IPresenterMetadata.cs" />
<Compile Include="ComponentModel\Lifetime.cs" />
<Compile Include="ComponentModel\ObservableObject.cs" />
<Compile Include="Presentation\CommandModel\Command.cs" />
<Compile Include="Presentation\CommandModel\CommandAttribute.cs" />
<Compile Include="Presentation\UI\DpiServices.cs" />
<Compile Include="Presentation\UI\Renderer\DeviceToolStripNativeRender.cs" />
<Compile Include="StringComparers.cs" />
<Compile Include="UI\Commands\CommandId.cs" />
<Compile Include="ApplicationModel\IApplication.cs" />
<Compile Include="Audio\InputSwitcherService.cs" />
<Compile Include="ApplicationModel\IStartupService.cs" />
<Compile Include="ApplicationModel\SaveSettingsService.cs" />
<Compile Include="ApplicationModel\SingleInstanceStartupService.cs" />
<Compile Include="ApplicationModel\NotificationIconStartupService.cs" />
<Compile Include="UI\Commands\DeviceSeparatorCommand.cs" />
<Compile Include="UI\Commands\NoDevicesCommandBase.cs" />
<Compile Include="UI\Commands\NoRecordingDevicesCommand.cs" />
<Compile Include="UI\Commands\NoPlaybackDevicesCommand.cs" />
<Compile Include="UI\Commands\NoDevicesCommand.cs" />
<Compile Include="UI\Presenters\NotificationIconPresenter.cs" />
<Compile Include="UI\Presenters\PresenterId.cs" />
<Compile Include="UI\ViewModels\AudioDeviceDefaultState.cs" />
<Compile Include="UI\ViewModels\AudioDeviceViewModel.cs" />
<Compile Include="Audio\DefaultAudioDeviceEventArgs.cs" />
<Compile Include="Audio\AudioDeviceStateEventArgs.cs" />
<Compile Include="Audio\AudioDeviceRemovedEventArgs.cs" />
<Compile Include="Audio\AudioDeviceEventArgs.cs" />
<Compile Include="ApplicationModel\AudioSwitcherApp.cs" />
<Compile Include="Interop\HResult.cs" />
<Compile Include="Audio\Interop\MMAudio\Blob.cs" />
<Compile Include="Audio\Interop\MMAudio\ClsCtx.cs" />
<Compile Include="Audio\AudioDeviceKind.cs" />
<Compile Include="Audio\AudioDeviceState.cs" />
<Compile Include="Audio\Interop\MMAudio\IMMDevice.cs" />
<Compile Include="Audio\Interop\MMAudio\IMMDeviceCollection.cs" />
<Compile Include="Audio\Interop\MMAudio\IMMDeviceEnumerator.cs" />
<Compile Include="Audio\Interop\MMAudio\IMMEndpoint.cs" />
<Compile Include="Audio\Interop\MMAudio\IMMNotificationClient.cs" />
<Compile Include="Audio\Interop\MMAudio\IPropertyStore.cs" />
<Compile Include="Audio\AudioDevice.cs" />
<Compile Include="Audio\AudioDeviceCollection.cs" />
<Compile Include="Audio\AudioDeviceManager.cs" />
<Compile Include="Audio\Interop\MMAudio\MMDeviceEnumerator.cs" />
<Compile Include="Audio\Interop\MMAudio\PropertyKey.cs" />
<Compile Include="Audio\Interop\MMAudio\PropertyKeys.cs" />
<Compile Include="Audio\Interop\MMAudio\PropertyStore.cs" />
<Compile Include="Audio\Interop\MMAudio\PropertyStoreProperty.cs" />
<Compile Include="Audio\Interop\MMAudio\PropVariant.cs" />
<Compile Include="Audio\AudioDeviceRole.cs" />
<Compile Include="Audio\Interop\MMAudio\StorageAccessMode.cs" />
<Compile Include="Audio\Interop\MMAudio\PolicyConfig.cs" />
<Compile Include="Interop\ExternalDll.cs" />
<Compile Include="Presentation\UI\ToolStripItemCommandBinding.cs" />
<Compile Include="Presentation\CommandModel\CommandManager.cs" />
<Compile Include="Presentation\CommandModel\CommandOfT.cs" />
<Compile Include="Presentation\CommandModel\CommandProperty.cs" />
<Compile Include="UI\Commands\AutomaticallySwitchToPluggedInDeviceCommand.cs" />
<Compile Include="UI\Commands\RunAtWindowsStartupCommand.cs" />
<Compile Include="UI\Commands\SetAsDefaultCommunicationDeviceCommand.cs" />
<Compile Include="UI\Commands\SetAsDefaultDeviceCommandBase.cs" />
<Compile Include="UI\Commands\SetAsDefaultMultimediaDeviceCommand.cs" />
<Compile Include="UI\Commands\ShowNotPresentDevicesCommand.cs" />
<Compile Include="Presentation\CommandModel\ICommand.cs" />
<Compile Include="Presentation\CommandModel\ICommandMetadata.cs" />
<Compile Include="Presentation\Drawing\DrawingServices.cs" />
<Compile Include="Presentation\Drawing\IconExtractor.cs" />
<Compile Include="Presentation\Drawing\IconInfo.cs" />
<Compile Include="Presentation\Drawing\Interop\DllImports.cs" />
<Compile Include="Presentation\Drawing\Interop\EnumResNameProc.cs" />
<Compile Include="Presentation\Drawing\Interop\GroupIconDir.cs" />
<Compile Include="Presentation\Drawing\Interop\GroupIconDirEntry.cs" />
<Compile Include="Presentation\Drawing\Interop\IconDirEntry.cs" />
<Compile Include="Presentation\Drawing\Interop\IconDir.cs" />
<Compile Include="Presentation\Drawing\Interop\LoadLibraryExFlags.cs" />
<Compile Include="Presentation\Drawing\Interop\LookupIconIdFromDirectoryExFlags.cs" />
<Compile Include="Presentation\Drawing\Interop\ResourceTypes.cs" />
<Compile Include="Presentation\Drawing\Interop\SafeModuleHandle.cs" />
<Compile Include="Presentation\Drawing\ResourceName.cs" />
<Compile Include="Presentation\Drawing\ShellIcon.cs" />
<Compile Include="Presentation\UI\AudioContextMenuStrip.cs">
<Compile Update="Presentation\UI\AudioContextMenuStrip.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Presentation\CommandModel\DisabledCommand.cs" />
<Compile Include="UI\Commands\ShowPlaybackDevicesCommand.cs" />
<Compile Include="UI\Commands\ShowRecordingDevicesCommand.cs" />
<Compile Include="Presentation\UI\AudioToolStripMenuItem.cs">
<Compile Update="Presentation\UI\AudioToolStripMenuItem.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Presentation\UI\Interop\DllImports.cs" />
<Compile Include="Audio\Interop\MMAudio\IPolicyConfig3.cs" />
<Compile Include="UI\Presenters\NotificationIconContextMenuPresenter.cs" />
<Compile Include="UI\Presenters\DeviceFlyoutPresenter.cs" />
<Compile Include="UI\Commands\ExitCommand.cs" />
<Compile Include="UI\Commands\AudioDeviceCommand.cs" />
<Compile Include="UI\Commands\ShowUnpluggedDevicesCommand.cs" />
<Compile Include="UI\Commands\ShowDisabledDevicesCommand.cs" />
<Compile Include="Presentation\UI\ToolStripExtensions.cs" />
<Compile Include="Presentation\UI\Renderer\MenuPopupCheckBackgroundStates.cs" />
<Compile Include="Presentation\UI\Renderer\MarginTypes.cs" />
<Compile Include="Presentation\UI\Renderer\MenuPopupSubMenuStates.cs" />
<Compile Include="Presentation\UI\Renderer\MenuPopupCheckStates.cs" />
<Compile Include="Presentation\UI\Renderer\MenuPopupItemStates.cs" />
<Compile Include="Presentation\UI\Renderer\MenuBarItemStates.cs" />
<Compile Include="Presentation\UI\Renderer\MenuBarStates.cs" />
<Compile Include="Presentation\UI\Renderer\MenuParts.cs" />
<Compile Include="Presentation\UI\Renderer\ToolStripNativeRenderer.cs" />
<Compile Include="Presentation\UI\Interop\MARGINS.cs" />
<Compile Include="Presentation\UI\Renderer\ToolbarTheme.cs" />
<Compile Include="Presentation\UI\UIServices.cs" />
<Compile Include="UI\ViewModels\AudioDeviceViewModelManager.cs" />
<Compile Include="UI\ViewModels\AudioDeviceViewModelEventArgs.cs" />
<Compile Include="UI\Views\DeviceFlyoutView.cs">
<Compile Update="UI\Views\DeviceFlyoutView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Win32\InteropServices\Win32Marshal.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Program.cs" />
<Compile Include="Resources\Resources.Designer.cs">
<Compile Update="Resources\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<Compile Update="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Win32\RegistryKeyExtensions.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\App.config" />
<None Include="Properties\App.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand All @@ -206,7 +62,7 @@
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Resources.resx">
<EmbeddedResource Update="Resources\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<CustomToolNamespace>AudioSwitcher</CustomToolNamespace>
Expand All @@ -224,9 +80,7 @@
<None Include="Resources\Images\RecordingDevice_16x16.png" />
<None Include="Resources\Images\NotPresent_16x16.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Resources\Images\FallbackDevice.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
19 changes: 0 additions & 19 deletions src/AudioSwitcher/Properties/AssemblyInfo.cs

This file was deleted.

14 changes: 14 additions & 0 deletions src/AudioSwitcher/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>net48</TargetFramework>
<PublishDir>bin\Release\net48\publish\</PublishDir>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
</PropertyGroup>
</Project>