Skip to content

Commit

Permalink
prepare for the release of separate packages
Browse files Browse the repository at this point in the history
  • Loading branch information
todd committed Aug 28, 2023
1 parent da3ceec commit 2376ac6
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 13 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/dotnet-deploy.yaml
@@ -1,11 +1,14 @@
name: "Deploy to Nuget"
# Step One: Perhaps most importantly, the trigger has changed, this workflow will run whenever a tag is pushed
# to the repository that matches the v#.#.# pattern (where # is one or more digits).
on:
push:
tags:
# note: this could be more constrained—"v[0-9]+.[0-9]+.[0-9]+"
- "v*.*.*"

env:
PROJECT_PATH: "./src/Novu/Novu.csproj"
WORKING_DIRECTORY: "./src/"
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json"

Expand All @@ -18,17 +21,35 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Build Novu
working-directory: ./src/Novu

# Step Two: build
- name: Build Novu Solution (all projects)
working-directory: ${{ WORKING_DIRECTORY }}
run: dotnet build --configuration Release

# Step Three: package each of the libraries with the version updated (note: this allow source to hold version 0.0.0)
- name: Get version
id: version
uses: battila7/get-version-action@v2

- name: Create Nuget package
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: [Novu] — create Nuget package
## dotnet pack Novu/Novu.csproj --no-restore --no-build --configuration Release -p:PackageVersion=0.0.0.0 -p:Version=0.0.0.0 --output .
run: dotnet pack ${{ env.WORKING_DIRECTORY }}/Novu/Novu.csproj --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.version.outputs.version-without-v }} -p:Version=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: [Novu.Extensions] — create Nuget package
## dotnet pack Novu.Extensions/Novu.Extensions.csproj --no-restore --no-build --configuration Release -p:PackageVersion=0.0.0.0 -p:Version=0.0.0.0 --output .
run: dotnet pack ${{ env.WORKING_DIRECTORY }}/Novu.Extensions/Novu.Extensions.csproj --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.version.outputs.version-without-v }} -p:Version=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: [Novu.Sync] — create Nuget package
## dotnet pack Novu.Sync/Novu.Sync.csproj --no-restore --no-build --configuration Release -p:PackageVersion=0.0.0.0 -p:Version=0.0.0.0 --output .
run: dotnet pack ${{ env.WORKING_DIRECTORY }}/Novu.Sync/Novu.Sync.csproj --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.version.outputs.version-without-v }} -p:Version=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

# Step Four: publish all
- name: [Novu] — push Nuget package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}/Novu.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL}}

- name: [Novu.Extensions] — push Nuget package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}/Novu.Extensions.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL}}

- name: Push Nuget package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}/*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL}}
- name: [Novu.Sync] — push Nuget package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}/Novu.Sync.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL}}
21 changes: 21 additions & 0 deletions src/Novu.Extensions/LICENSE.txt
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 picmi/toddb

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 7 additions & 1 deletion src/Novu.Extensions/Novu.Extensions.csproj
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup>
<PackageId>Novu.Extensions</PackageId>
<Version>0.3.1</Version>
<ProductName>Novu</ProductName>
<ProductName>Novu.Extensions</ProductName>
<Description>Novu .NET SDK</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/novuhq/novu-dotnet</RepositoryUrl>
Expand All @@ -35,4 +35,10 @@
<ProjectReference Include="..\Novu\Novu.csproj"/>
</ItemGroup>

<!-- Nuget Assets -->
<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<None Include="LICENSE.txt" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions src/Novu.Sync/LICENSE.txt
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 picmi/toddb

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 10 additions & 4 deletions src/Novu.Sync/Novu.Sync.csproj
Expand Up @@ -8,9 +8,9 @@

<!-- Nuget Settings -->
<PropertyGroup>
<PackageId>Novu.Extensions</PackageId>
<PackageId>Novu.Sync</PackageId>
<Version>0.3.1</Version>
<ProductName>Novu</ProductName>
<ProductName>Novu.Sync</ProductName>
<Description>Novu .NET SDK</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/novuhq/novu-dotnet</RepositoryUrl>
Expand All @@ -23,8 +23,14 @@
<ProjectReference Include="..\Novu\Novu.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0"/>
</ItemGroup>

<!-- Nuget Assets -->
<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<None Include="LICENSE.txt" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>

0 comments on commit 2376ac6

Please sign in to comment.