WIP2 sync dotnet install version #3
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Run | |
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@v3 | |
with: | |
dotnet-version: 8.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 |