Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Nethereum metapackage #4

Merged
merged 4 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,57 @@ jobs:
run: |
cd src
& ".\nugetDevBuild.bat"
push:
needs: build
runs-on: ubuntu-22.04
env:
BASE_VERSION: 4.20.0

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

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Add dependencies
run: |
dotnet new classlib --name Nethereum --framework netstandard2.0
cd Nethereum
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.ABI
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Accounts
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Contracts
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Hex
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.KeyStore
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.RLP
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.RPC
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Signer
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.StandardTokenEIP20
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Util
dotnet add package --version ${{env.BASE_VERSION}} Nethereum.Web3
rm Class1.cs
- name: Pack
run: |
cd Nethereum
VERSION="$(dotnet fsi ../nugetPreRelease.fsx $BASE_VERSION)"
dotnet pack \
--configuration Release \
--output ../dist \
--property:IncludeBuildOutput=false \
--property:IncludeContentInPack=false \
--property:TargetFrameworks=netstandard2.0 \
--property:Version=$VERSION
- name: Push
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webwarrior-ws please add an if here that has three conditions:

  1. checks secrets.NUGET_API_KEY is not empty
  2. checks github.event_name == 'push'
  3. checks github.ref == 'refs/heads/upstream'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if: github.event_name == 'push' && github.ref == 'refs/heads/upstream'
run: |
cd dist
if [ -n "${{secrets.NUGET_API_KEY}}" ]; then
dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
fi
6 changes: 6 additions & 0 deletions nugetPreRelease.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#r "nuget: Fsdk, Version=0.6.0--date20231213-0703.git-d7a5962"

let args = fsi.CommandLineArgs

Fsdk.Network.GetNugetPrereleaseVersionFromBaseVersion args.[1]
|> System.Console.WriteLine
Loading