-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (44 loc) · 1.92 KB
/
Publish-to-NuGet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Publish to NuGet
# on Push tags matching v1.0.0 or v1.0.0-suffix
on:
push:
tags:
[ "v[0-9]+.[0-9]+.[0-9]+", "v[0-9]+.[0-9]+.[0-9]+-[0-9a-z]+" ]
jobs:
build:
env:
SOLUTION: 'src\Rhythm.Drop.Umbraco.sln'
BUILD_CONFIG: 'Release'
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Remove 'v' prefix from tag to match NuGet version format
- name: Set Package Version
run: |
echo "PACKAGE_VERSION=${GITHUB_REF_NAME/v/}" >> "$GITHUB_ENV"
- name: Display Package Version
run: |
echo "Package Version: $PACKAGE_VERSION"
# Start packaging process
- name: Restore dependencies
run: dotnet restore $SOLUTION
- name: Pack Rhythm.Drop.Umbraco.Builders
run: dotnet pack ./src/Rhythm.Drop.Umbraco.Builders/Rhythm.Drop.Umbraco.Builders.csproj --no-restore -c $BUILD_CONFIG /p:version=$PACKAGE_VERSION
- name: Pack Rhythm.Drop.Umbraco.Mapping
run: dotnet pack ./src/Rhythm.Drop.Umbraco.Mapping/Rhythm.Drop.Umbraco.Mapping.csproj --no-restore -c $BUILD_CONFIG /p:version=$PACKAGE_VERSION
- name: Pack Rhythm.Drop.Umbraco.Web
run: dotnet pack ./src/Rhythm.Drop.Umbraco.Web/Rhythm.Drop.Umbraco.Web.csproj --no-restore -c $BUILD_CONFIG /p:version=$PACKAGE_VERSION
- name: Pack Rhythm.Drop.Umbraco
run: dotnet pack ./src/Rhythm.Drop.Umbraco/Rhythm.Drop.Umbraco.csproj --no-restore -c $BUILD_CONFIG /p:version=$PACKAGE_VERSION
- name: Publish Packages to NuGet
run: dotnet nuget push **\*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json