This repository has been archived by the owner on Aug 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (77 loc) · 2.72 KB
/
dotnet-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: BuildAndDeploy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
env:
Solution_Name: Ctrl2MqttBridge.sln
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: 5.0.x
# Execute all unit tests in the solution
# - name: Execute unit tests
# run: dotnet test --configuration ${{ matrix.configuration }}
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Build
run: dotnet build --configuration ${{ matrix.configuration }}
# run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
# env:
# Configuration: ${{ matrix.configuration }}
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the nuget package
run: dotnet pack --configuration ${{ matrix.configuration }}
# - name: print dir
# run: dir
# run: dir src
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Ctrl2MqttBridgeInstaller
# path: src\Ctrl2MqttBridge\Ctrl2MqttBridgeSetup*.exe
# - name: Install 7Zip PowerShell Module
# shell: powershell
# run: Install-Module 7Zip4PowerShell -Force -Verbose
# - name: Compress generated Binaries
# run: Compress-7zip src\Ctrl2MqttBridge\Ctrl2MqttBridgeSetup*.* -ArchiveFileName "Ctrl2MqttBridgeSetup.zip" -Format Zip
# - name: dir
# run: dir
# - name: Create Release
# id: create_release
# uses: actions/create-release@latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}_releasebypip
# release_name: Release ${{ github.ref }}
# body: |
# Automated Release by GitHub Action CI
# draft: false
# prerelease: true
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Ctrl2MqttBridgeSetup.zip
# asset_name: Ctrl2MqttBridgeSetup.zip
# asset_content_type: application/zip
- name: Push NuGet package to NuGet.org
env:
API_KEY: ${{secrets.NUGET_API_KEY}}
run: dotnet nuget push src\Ctrl2MqttClient\bin\Release\*.nupkg --api-key "$env:API_KEY" --source https://api.nuget.org/v3/index.json --no-symbols true