diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..debd6ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -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/setup@v0.9.2 + with: + versionSpec: '5.2.x' + + - name: Use GitVersion + id: gitversion # step id used as reference for output values + uses: gittools/actions/gitversion/execute@v0.9.2 + + - 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/setup-nuget@v1.0.2 + + - 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/upload-artifact@v1.0.0 + 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/create-release@v1.0.0 + 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/upload-release-asset@v1.0.1 + 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') + diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..a013f09 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,6 @@ +mode: ContinuousDeployment +branches: + master: + tag: beta + hotfix: + tag: useBranchName \ No newline at end of file diff --git a/src/AudioSwitcher.sln b/src/AudioSwitcher.sln index 3c5b9ff..0e66b08 100644 --- a/src/AudioSwitcher.sln +++ b/src/AudioSwitcher.sln @@ -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 @@ -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 diff --git a/src/AudioSwitcher/AudioSwitcher.csproj b/src/AudioSwitcher/AudioSwitcher.csproj index b18e37d..dfab94d 100644 --- a/src/AudioSwitcher/AudioSwitcher.csproj +++ b/src/AudioSwitcher/AudioSwitcher.csproj @@ -1,41 +1,23 @@ - - - + - Debug - AnyCPU - {8F82476F-30DC-47A5-80A0-AB8437E4EEA5} WinExe - Properties - AudioSwitcher - AudioSwitcher - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + net48 + AudioSwitcher + AudioSwitcher + en + Copyright (c) David Kean + 0.1.0.0 + 0.1.0.0 + bin\$(Configuration)\ x86 - false false true + + full + pdbonly - true - bin\Release\ - TRACE - prompt - 4 - x86 - false - false - true AudioSwitcher.Program @@ -47,157 +29,31 @@ Properties\App.manifest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Component - - - - + Component - - - - - - - - - - - - - - - - - - - - - - - - + Component - - - - + True True Resources.resx - + True True Settings.settings - - SettingsSingleFileGenerator @@ -206,7 +62,7 @@ - + ResXFileCodeGenerator Designer AudioSwitcher @@ -224,9 +80,7 @@ - - \ No newline at end of file diff --git a/src/AudioSwitcher/Properties/AssemblyInfo.cs b/src/AudioSwitcher/Properties/AssemblyInfo.cs deleted file mode 100644 index 452fc78..0000000 --- a/src/AudioSwitcher/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) David Kean. -// ----------------------------------------------------------------------- -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("AudioSwitcher")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AudioSwitcher")] -[assembly: AssemblyCopyright("Copyright (c) David Kean")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/AudioSwitcher/Properties/PublishProfiles/FolderProfile.pubxml b/src/AudioSwitcher/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..84456cb --- /dev/null +++ b/src/AudioSwitcher/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + Release + Any CPU + net48 + bin\Release\net48\publish\ + win7-x86 + + \ No newline at end of file