Create README.md #12
Workflow file for this run
This file contains hidden or 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" | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| SOLUTION_FILE: ValueMapper/ValueMapper.sln | |
| PROJECT_PATH: ValueMapper/ValueMapperCore/ValueMapper.csproj | |
| PACKAGE_OUTPUT_DIRECTORY: D:/a/ValueMapper/ValueMapper/output | |
| NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json" | |
| jobs: | |
| deploy: | |
| name: "Deploy" | |
| runs-on: "windows-latest" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v3 | |
| - name: "Install dotnet" | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: "Restore packages" | |
| run: dotnet restore ${{ env.SOLUTION_FILE }} | |
| - name: "Build project" | |
| run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release | |
| - name: "Get Version" | |
| id: version | |
| uses: battila7/get-version-action@v2 | |
| - name: "Pack project" | |
| run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} | |
| - name: "List package directory contents" | |
| run: dir "${{ env.PACKAGE_OUTPUT_DIRECTORY }}" | |
| shell: cmd | |
| - name: "Push main package" | |
| run: dotnet nuget push "${{ env.PACKAGE_OUTPUT_DIRECTORY }}/ValueMapper.1.0.0.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE_URL }} | |
| - name: "Push symbols package" | |
| run: dotnet nuget push "${{ env.PACKAGE_OUTPUT_DIRECTORY }}/ValueMapper.1.0.0.symbols.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE_URL }} |