push-to-nuget #8
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: push-to-nuget | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: create ArtifactStagingDirectory folder | |
run: mkdir drop | |
# Building and copying React | |
- name: npm install durablefunctionsmonitor.react | |
run: npm install -legacy-peer-deps | |
working-directory: durablefunctionsmonitor.react | |
- name: npm build durablefunctionsmonitor.react | |
run: npm run build | |
working-directory: durablefunctionsmonitor.react | |
- name: copy statics to durablefunctionsmonitor.dotnetbackend/DfmStatics | |
run: | | |
rm -rf durablefunctionsmonitor.dotnetbackend/DfmStatics | |
cp -r durablefunctionsmonitor.react/build durablefunctionsmonitor.dotnetbackend/DfmStatics | |
- name: copy statics to durablefunctionsmonitor.dotnetisolated/DfmStatics | |
run: | | |
rm -rf durablefunctionsmonitor.dotnetisolated/DfmStatics | |
cp -r durablefunctionsmonitor.react/build durablefunctionsmonitor.dotnetisolated/DfmStatics | |
# Building and testing .NET | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: dotnet test tests/durablefunctionsmonitor.dotnetbackend.tests | |
run: dotnet test tests/durablefunctionsmonitor.dotnetbackend.tests/*.csproj | |
- name: dotnet test tests/durablefunctionsmonitor.dotnetisolated.core.tests | |
run: dotnet test tests/durablefunctionsmonitor.dotnetisolated.core.tests/*.csproj | |
- name: copy durablefunctionsmonitor.dotnetbackend to ArtifactStagingDirectory | |
run: cp -r durablefunctionsmonitor.dotnetbackend drop/durablefunctionsmonitor.dotnetbackend | |
- name: copy durablefunctionsmonitor.dotnetisolated to ArtifactStagingDirectory | |
run: cp -r durablefunctionsmonitor.dotnetisolated drop/durablefunctionsmonitor.dotnetisolated | |
- name: dotnet publish durablefunctionsmonitor.dotnetbackend | |
run: dotnet publish durablefunctionsmonitor.dotnetbackend --output drop/durablefunctionsmonitor.dotnetbackend/output | |
- name: dotnet publish durablefunctionsmonitor.dotnetisolated | |
run: dotnet publish durablefunctionsmonitor.dotnetisolated --output drop/durablefunctionsmonitor.dotnetisolated/output | |
# Building nuget packages | |
- name: copy LICENSE to durablefunctionsmonitor.dotnetbackend/output | |
run: cp LICENSE drop/durablefunctionsmonitor.dotnetbackend/output | |
- name: copy LICENSE.txt to durablefunctionsmonitor.dotnetisolated/output | |
run: cp durablefunctionsmonitor.dotnetisolated/LICENSE.txt drop/durablefunctionsmonitor.dotnetisolated/output | |
- name: Install latest nuget.exe | |
uses: nuget/[email protected] | |
- name: package dotnetbackend into a Nuget package | |
run: nuget pack drop/durablefunctionsmonitor.dotnetbackend/output/nuspec.nuspec -OutputDirectory drop | |
- name: package dotnetisolated into a Nuget package | |
run: nuget pack drop/durablefunctionsmonitor.dotnetisolated/output/nuspec.nuspec -OutputDirectory drop | |
# Pushing nuget packages | |
- name: push drop/DurableFunctionsMonitor.DotNetIsolated | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: nuget push drop/DurableFunctionsMonitor.DotNetIsolated.*.nupkg -ApiKey $NUGET_API_KEY -src https://api.nuget.org/v3/index.json | |
- name: push drop/DurableFunctionsMonitor.DotNetBackend | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: nuget push drop/DurableFunctionsMonitor.DotNetBackend.*.nupkg -ApiKey $NUGET_API_KEY -src https://api.nuget.org/v3/index.json |