Skip to content

NuGet Push All - v2.0.0-preview.1.0.9 #10

NuGet Push All - v2.0.0-preview.1.0.9

NuGet Push All - v2.0.0-preview.1.0.9 #10

name: NuGet Push All
run-name: NuGet Push All - ${{ github.event.inputs.project_name }} v${{ github.event.inputs.version_number }}
on:
workflow_dispatch:
inputs:
version_number:
description: 'Version number of the package'
required: true
default: '1.0.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Validate version number format
run: |
if [[ ! "${{ github.event.inputs.version_number }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-preview\.[0-9]+\.[0-9]+\.[0-9]+)?$ ]]; then
echo "Invalid version number format. Version number should be in the format '[0-9].[0-9].[0-9]' or '[0-9].[0-9].[0-9]-preview.[0-9].[0-9].[0-9]'."
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Build Project
run: dotnet build --configuration Release
- name: Create Release
run: gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --notes "" --draft
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Pack NuGet package
run: dotnet pack --configuration Release --output nupkgs /p:PackageVersion=${{ github.event.inputs.version_number }}
- name: Push NuGet package
run: dotnet nuget push nupkgs/Ogu.AspNetCore.Response.Abstractions.${{ github.event.inputs.version_number }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- name: Push NuGet package
run: dotnet nuget push nupkgs/Ogu.AspNetCore.Response.Json.${{ github.event.inputs.version_number }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- name: Push NuGet package
run: dotnet nuget push nupkgs/Ogu.Response.Abstractions.${{ github.event.inputs.version_number }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- name: Push NuGet package
run: dotnet nuget push nupkgs/Ogu.Response.Json.${{ github.event.inputs.version_number }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}