Skip to content

Commit

Permalink
Merge pull request #255 from IOTA-NET/main
Browse files Browse the repository at this point in the history
Create Nuget.yml
  • Loading branch information
wireless90 authored Jan 8, 2024
2 parents 23581b5 + 1694ed3 commit 213b2da
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/Nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy IotaSDK.NET to NuGet

on:
workflow_dispatch:
release:
types: [published]

env:
SOLUTION_PATH: ./IotaSDK.NET/IotaSDK.NET.csproj
NUGET_PATH: ${{ github.workspace }}/nugets
NUGET_SRC_URL: 'https://api.nuget.org/v3/index.json'

jobs:
build:
runs-on: ubuntu-latest
environment: myenv

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 3.1.x # Adjust to match your project's .NET version

- name: Restore dependencies
run: dotnet restore ${{ env.SOLUTION_PATH }}

- name: Build
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore

- name: Get Version
id: version
uses: battila7/get-version-action@v2

- name: Pack Nuget
run: dotnet pack ${{ env.SOLUTION_PATH }} -c Release /p:Version=${{ steps.version.outputs.version-without-v }} /p:PackageReleaseNotes="See https://github.com/IOTA-NET/IotaSDK.NET/releases/tag/${{ github.event.release.tag_name }}" --include-symbols --output ${{ env.NUGET_PATH }}

- name: Create NuGet Package Artifact
uses: actions/upload-artifact@v1
with:
name: IotaSDK
path: ${{ env.NUGET_PATH }}/IotaSDK.${{ steps.version.outputs.version-without-v }}.nupkg

- name: Push Nuget to NuGet.org
run: dotnet nuget push ${{ env.NUGET_PATH }}/*.nupkg -s ${{ env.NUGET_SRC_URL }} --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols

0 comments on commit 213b2da

Please sign in to comment.