From 910b0b5db0a5a26c24bdf105186174902e95580d Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sat, 3 Oct 2020 23:36:26 +1300 Subject: [PATCH] Create dotnet-core-desktop.yml --- .github/workflows/dotnet-core-desktop.yml | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/dotnet-core-desktop.yml diff --git a/.github/workflows/dotnet-core-desktop.yml b/.github/workflows/dotnet-core-desktop.yml new file mode 100644 index 0000000..74e86e6 --- /dev/null +++ b/.github/workflows/dotnet-core-desktop.yml @@ -0,0 +1,61 @@ +name: .NET Core Desktop + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + strategy: + matrix: + configuration: [Release] + + runs-on: + windows-latest # For a list of available runner types, refer to + # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on + + env: + Solution_Name: ThunderbirdTray.sln + Configuration: ${{ matrix.configuration }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + - name: Install 7zip + run: | + Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-x64.exe -OutFile 7z.exe + ./7z.exe /S /D="${{ github.workspace }}\7z\" + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16 + + - name: Build Solution + run: msbuild $env:Solution_Name /restore /p:Configuration=$env:Configuration + + - name: Publish NETCore Application + run: msbuild /t:publish netcore/ThunderbirdTray.NETCore.csproj /p:Configuration=$env:Configuration + + - name: Pack Artifacts + run: | + ./7z/7z.exe a -mx=9 ThunderbirdTray.NETCore-selfcontained.zip ".\netcore\bin\$env:Configuration\netcoreapp3.1\win-x86\publish\*" + ./7z/7z.exe a -mx=9 ThunderbirdTray.NETFramework.zip ".\netframework\bin\$env:Configuration\*" -x!*\ + dir *.zip + + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: ThunderbirdTray + if-no-files-found: error + path: '*.zip'