From 42aee1c8949dea18d6ad28617b7256c3d45f5568 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Carle <29762210+jscarle@users.noreply.github.com> Date: Fri, 16 Dec 2022 17:27:03 -0500 Subject: [PATCH] Updated actions and version. (#13) * Updated Github actions. * Updated version. --- .github/dependabot.yml | 11 ++++++++++ .github/release.yml | 7 +++++++ .github/workflows/develop.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/master.yml | 39 +++++++++++++++++++++++++++++++++++ .github/workflows/msbuild.yml | 32 ---------------------------- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++ HyperV.NET/HyperV.NET.csproj | 6 +++--- 7 files changed, 126 insertions(+), 35 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/develop.yml create mode 100644 .github/workflows/master.yml delete mode 100644 .github/workflows/msbuild.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8c23067 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..6072919 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,7 @@ +# .github/release.yml + +changelog: + categories: + - title: Changes + labels: + - "*" diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 0000000..7719327 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,33 @@ +name: Development + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +jobs: + build: + name: Build + runs-on: windows-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Debug --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..cafb39b --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: Build + runs-on: windows-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: 'csharp' + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml deleted file mode 100644 index 4a5d309..0000000 --- a/.github/workflows/msbuild.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: MSBuild - -on: [push] - -env: - # Path to the solution file relative to the root of the project. - SOLUTION_FILE_PATH: . - - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - BUILD_CONFIGURATION: Release - -jobs: - build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1 - - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} - - - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1b8d296 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + name: Build + runs-on: windows-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Pack + run: dotnet pack --configuration Release --no-build --output . + - name: Push to NuGet + run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json diff --git a/HyperV.NET/HyperV.NET.csproj b/HyperV.NET/HyperV.NET.csproj index 658112f..df3a1c0 100644 --- a/HyperV.NET/HyperV.NET.csproj +++ b/HyperV.NET/HyperV.NET.csproj @@ -5,17 +5,17 @@ HyperV.NET HyperV HyperV.NET - 1.0.176.0 + 1.1.0.0 Jean-Sebastien Carle Jean-Sebastien Carle HyperV.NET Simple Hyper-V Virtual Machine Management LICENSE.md false - Copyright © Jean-Sebastien Carle 2019-2021 + Copyright © Jean-Sebastien Carle 2019-2022 https://github.com/jscarle/HyperV.NET git - Added TurnOffVirtualMachine method. + Updated target frameworks.