Merge pull request #88 from novuhq/todd/versioning-differences #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
WORKING_DIRECTORY: "./src/" | |
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output | |
NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Step Two: build | |
- name: Build Novu Solution (all projects) | |
working-directory: ${{ env.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: 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: 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}} |