diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bbfb70062..eb1a38bc1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -22,3 +22,47 @@ jobs: run: | cd src & ".\nugetDevBuild.bat" + + push: + needs: build + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + + - name: Add dependencies + run: | + dotnet new classlib -n Nethereum --framework netstandard2.0 + cd Nethereum + dotnet add package Nethereum.ABI + dotnet add package Nethereum.Accounts + dotnet add package Nethereum.Contracts + dotnet add package Nethereum.Hex + dotnet add package Nethereum.KeyStore + dotnet add package Nethereum.RLP + dotnet add package Nethereum.RPC + dotnet add package Nethereum.Signer + dotnet add package Nethereum.StandardTokenEIP20 + dotnet add package Nethereum.Util + dotnet add package Nethereum.Web3 + rm Class1.cs + + - name: Pack + run: | + cd Nethereum + DATE=$(date +%Y%m%d-%H%M) + GIT_COMMIT=$(git rev-parse --short HEAD) + VERSION="1.0.0+$DATE.$GIT_COMMIT" + dotnet pack -c Release -o ../dist -p:IncludeBuildOutput=false -p:IncludeContentInPack=false -p:TargetFrameworks=netstandard2.0 -p:Version=$VERSION + +# disabled for now, comes from https://github.com/Mersho/Nethereum/commits/NethMetapackage +# - name: Push +# run: | +# cd dist +# dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json