add utility methods #5
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: Publish Nuget | |
#on: | |
# workflow_dispatch: | |
# branches: [ "main" ] | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- source/libraries/** | |
env: | |
AZURE_ARTIFACTS_FEED_URL: https://fuselabs.pkgs.visualstudio.com/c861868a-1061-43d1-8232-ed9ab373867c/_packaging/Crazor/nuget/v3/index.json | |
DOTNET_VERSION: '7.x' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Get version timestamp | |
id: t1 | |
uses: Kaven-Universe/github-action-current-date-time@v1.1.0 | |
with: | |
format: "YYYYMMDDHHmm" | |
# Checkout the repo | |
- uses: actions/checkout@v3 | |
# Setup .NET Core SDK | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
source-url: ${{ env.AZURE_ARTIFACTS_FEED_URL }} | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_ARTIFACTS_PAT }} | |
# Run dotnet build and package | |
# dotnet pack -c Debug --no-restore --version-suffix beta-$(date +'%Y%m%d%H%M') source/libraries/Crazor/Crazor.csproj | |
- name: dotnet restore | |
run: dotnet restore source/Crazor.sln | |
- name: dotnet build | |
run: dotnet build -c Debug --no-restore source/Crazor.sln | |
- name: dotnet pack Crazor | |
run: dotnet pack -c Debug --no-restore --version-suffix "beta-${{ steps.t1.outputs.time }}" source/Crazor.sln | |
- name: dotnet push | |
run: | | |
dotnet nuget push --api-key AzureArtifacts "source/libraries/Crazor/bin/Debug/Crazor.1.0.0-beta-${{ steps.t1.outputs.time }}.nupkg" | |
dotnet nuget push --api-key AzureArtifacts "source/libraries/Crazor.Mvc/bin/Debug/Crazor.Mvc.1.0.0-beta-${{ steps.t1.outputs.time }}.nupkg" | |
dotnet nuget push --api-key AzureArtifacts "source/libraries/Crazor.Blazor/bin/Debug/Crazor.Blazor.1.0.0-beta-${{ steps.t1.outputs.time }}.nupkg" | |
dotnet nuget push --api-key AzureArtifacts "source/libraries/Crazor.Server/bin/Debug/Crazor.Server.1.0.0-beta-${{ steps.t1.outputs.time }}.nupkg" | |
dotnet nuget push --api-key AzureArtifacts "source/libraries/Crazor.Test/bin/Debug/Crazor.Test.1.0.0-beta-${{ steps.t1.outputs.time }}.nupkg" |