-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (110 loc) · 3.41 KB
/
manual-deployment.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Manual Deployment
on:
workflow_dispatch:
inputs:
version:
description: 'Define the version to be published (SemVer)'
required: true
type: string
package:
description: 'Select which package to stage for publish'
required: true
default: 'warning'
type: choice
options:
- FluentSerializer.Core
- FluentSerializer.Json
- FluentSerializer.Json.DependencyInjection.NetCoreDefault
- FluentSerializer.Json.Converter.DefaultJson
- FluentSerializer.Xml
- FluentSerializer.Xml.DependencyInjection.NetCoreDefault
- FluentSerializer.Xml.Converter.DefaultXml
jobs:
dotnet-push:
name: "Push to NuGet.org"
runs-on: ubuntu-latest
environment:
name: NuGet
url: "https://www.nuget.org/packages/${{ github.event.inputs.package }}/${{ github.event.inputs.version }}"
steps:
###
# Checkout repository
###
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
###
# 🧰 Setup .Net
#
# Configure the pipeline to use the correct .Net sdk versions
###
- name: 🧰 Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
6.0.x
3.1.x
###
# 🔧 Fix version
#
# Override the libraries version info
###
- name: 🔧 Fix version
shell: pwsh
run: |-
${{github.workspace}}/.github/workflows/scripts/update-version.ps1 `
-Version "${{ github.event.inputs.version }}" `
-File "${{github.workspace}}/src/${{ github.event.inputs.package }}/${{ github.event.inputs.package }}.csproj";
###
# 🔧 Fix release notes
#
# Override the libraries release notes info
###
- name: 🔧 Fix release notes
shell: pwsh
run: |-
${{github.workspace}}/.github/workflows/scripts/update-release-notes.ps1 `
-File "${{github.workspace}}/src/${{ github.event.inputs.package }}/${{ github.event.inputs.package }}.csproj";
###
# 🔧 Update NuGet readme
#
# Update the NuGet readme with additional release metadata
###
- name: 🔧 Update NuGet readme
shell: pwsh
run: |-
${{github.workspace}}/.github/workflows/scripts/update-package-readme.ps1 `
-Path "${{github.workspace}}/src/${{ github.event.inputs.package }}";
###
# 🗃 Restore dependencies
#
# Fill the NuGet store with necessary libraries
###
- name: 🗃 Restore dependencies
run: dotnet restore
###
# 🛠 Build
#
# Build the library code for later use
###
- name: 🛠 Build
run: >-
dotnet build
"${{github.workspace}}/src/${{ github.event.inputs.package }}/${{ github.event.inputs.package }}.csproj"
--no-restore
--nologo
--configuration "Release"
-p:Version=${{ github.event.inputs.version }}
###
# 🗳 Push package
#
# Pack and push the package
###
- name: 🗳 Push package
run: >-
sudo dotnet nuget push ${{github.workspace}}/src/${{ github.event.inputs.package }}/bin/Release/${{ github.event.inputs.package }}.${{ github.event.inputs.version }}.nupkg
--api-key ${{ secrets.NUGET_TOKEN }}
--source https://api.nuget.org/v3/index.json
working-directory: ${{github.workspace}}/src/${{ github.event.inputs.package }}