publish-nuget #32
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: | |
inputs: | |
package-version: | |
description: "Package Version" | |
required: true | |
package-source: | |
type: choice | |
description: Package Source | |
required: true | |
default: "myget" | |
options: | |
- myget | |
- nuget | |
package-id: | |
type: choice | |
description: Package Id | |
required: true | |
default: "LocalStack.Client" | |
options: | |
- LocalStack.Client | |
- LocalStack.Client.Extensions | |
jobs: | |
publish-nuget: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Init | |
run: chmod +x ./build.sh | |
- name: Install NuGet | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Install .NET 6 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Install .NET 8 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Build & Test | |
run: ./build.sh | |
- name: "Print Version" | |
run: | | |
echo "Package Version: ${{ github.event.inputs.package-version }}" | |
- name: Remove Project Ref & Add latest pack | |
if: ${{ github.event.inputs.package-id == 'LocalStack.Client.Extensions' }} | |
run: cd src/LocalStack.Client.Extensions/ && dotnet remove reference ../LocalStack.Client/LocalStack.Client.csproj && dotnet add package LocalStack.Client | |
- name: Nuget Pack | |
run: ./build.sh --target nuget-pack --package-source ${{ github.event.inputs.package-source }} --package-id ${{ github.event.inputs.package-id }} --package-version ${{ github.event.inputs.package-version }} | |
- name: MyGet Push | |
if: ${{ github.event.inputs.package-source == 'myget' }} | |
run: ./build.sh --target nuget-push --package-source ${{ github.event.inputs.package-source }} --package-id ${{ github.event.inputs.package-id }} --package-version ${{ github.event.inputs.package-version }} --package-secret ${{secrets.MYGET_API_KEY}} | |
- name: NuGet Push | |
if: ${{ github.event.inputs.package-source == 'nuget' }} | |
run: ./build.sh --target nuget-push --package-source ${{ github.event.inputs.package-source }} --package-id ${{ github.event.inputs.package-id }} --package-version ${{ github.event.inputs.package-version }} --package-secret ${{secrets.NUGET_API_KEY}} |