-
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.76 KB
/
dotnet.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
name: Publish New Version
on:
workflow_dispatch:
inputs:
Pre-release:
description: 'Is this a pre-release?'
required: true
default: 'false'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
source-url: https://nuget.pkg.github.com/wagrenier/index.json
env:
owner: UNC-I
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore dependencies
run: dotnet restore PssMuxNet/PssMuxNet.sln
# Setups the env vars for gitversion
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x.x'
includePrerelease: true
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Build
run: dotnet build --no-restore -c Release PssMuxNet/PssMuxNet.sln
- name: Publish
run: dotnet publish -c Release /p:DebugType=None -o ./release PssMuxNet/PssMuxNet.sln
# Zips the binaries and required files
- name: Zip App
run: |
cd release
Compress-Archive * ../pssmux_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
# Creates a new TAG version
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: "${{ steps.gitversion.outputs.majorMinorPatch }}"
release_name: PssMux Release ${{ steps.gitversion.outputs.majorMinorPatch }}
draft: false
prerelease: ${{ github.event.inputs.pre-release }}
- name: Deploy NuGet
run: |
dotnet restore "PssMuxNet/PssMuxNet.sln"
dotnet build --configuration Release "PssMuxNet/PssMux/PssMux.csproj"
dotnet pack --configuration Release "PssMuxNet/PssMux/PssMux.csproj"
dotnet nuget push "PssMuxNet/PssMux/bin/Release/PssMux.**.**.**.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s "https://nuget.pkg.github.com/wagrenier/index.json"
# Releases the zipped assets
- name: Update 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: ./pssmux_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_name: pssmux_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
asset_content_type: application/zip