Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostWalker562 committed Sep 27, 2024
1 parent 93ee41c commit a240fb6
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 19 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Release NuGet Packages"

on:
push:
tags:
- "v*.*.*" # Trigger on version tags (e.g., v1.0.0)

jobs:
release:
name: Pack and Publish Packages to NuGet
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup .NET
uses: ./.github/actions/setup-dotnet

- name: Run Tests
run: dotnet test --no-restore --verbosity normal
working-directory: ./Aptos.Tests
shell: bash

- name: Pack Packages
run: dotnet pack --configuration Release --no-build --output ./artifacts

- name: Publish Packages to NuGet
run: |
dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
26 changes: 13 additions & 13 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefaultVersion>0.0.1</DefaultVersion>
<DefaultTargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1</DefaultTargetFrameworks>
<DefaultTestingFrameworks>net8.0</DefaultTestingFrameworks>
</PropertyGroup>
<PropertyGroup>
<DefaultVersion>0.0.2</DefaultVersion>
<DefaultTargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1</DefaultTargetFrameworks>
<DefaultTestingFrameworks>net8.0</DefaultTestingFrameworks>
</PropertyGroup>

<PropertyGroup Label="C#">
<LangVersion>latest</LangVersion>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<PropertyGroup Label="C#">
<LangVersion>latest</LangVersion>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Package.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>http://aptoslabs.dev/</PackageProjectUrl>
<PackageIcon>icon.jpg</PackageIcon>
<PackageVersion>$(DefaultVersion)-beta.1</PackageVersion>
<PackageVersion>$(DefaultVersion)-beta</PackageVersion>
<Copyright>Copyright (c) Aptos Labs 2024</Copyright>
</PropertyGroup>

Expand Down
68 changes: 63 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,75 @@

The Aptos .NET SDK is a library that provides a convenient way to interact with the Aptos blockchain using C# under the .NET framework. The SDK is designed to offer all the necessary tools to build applications that interact with the Aptos blockchain.

## Installation (WIP)
## Installation

The SDK is pending a release on NuGet. In the meantime, you can clone the repository and build the SDK locally.
The SDK is published onto [NuGet](https://www.nuget.org/packages/Aptos/) where you can install it using the following command:

### Unity
```bash
dotnet add package Aptos
```

### Unity (WIP)

> We are currently working on a `.unitypackage` for Unity developers. In the meantime, you can use the [NuGet](https://github.com/GlitchEnzo/NuGetForUnity) package manager to install the SDK into your Unity project.
1. Open Package Manager window (Window | Package Manager)
2. Click + button on the upper-left of a window, and select *Add package from git URL...*
3. Enter the following URL and click Add button

```
https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity
```

4. Click on `Manage NuGet Packages` from the `NuGet` menu in the Unity Editor.

![launch-nuget](https://github.com/GlitchEnzo/NuGetForUnity/raw/master/docs/screenshots/menu_item.png)

1. Search for `Aptos` and install the package. **Make sure to turn on `Show Prerelease` in the top left**.

(WIP)
![search-aptos](https://i.imgur.com/8UTvYtj.png)

### Godot

(WIP)
To install the Aptos SDK into your Godot project, you will need to add the Aptos SDK into your Godot project's `.csproj` file.

1. Find the `.csproj` file in the root of your Godot project.
2. Add the following line to the `<ItemGroup>` section of the `.csproj` file. If it doesn't exist, create it the `<ItemGroup>` section.

```xml
<Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace>AptosSDKExample</RootNamespace>
</PropertyGroup>

<!-- START: Add these lines -->
<ItemGroup>
<PackageReference Include="Aptos" Version="0.0.1-beta" />
</ItemGroup>
<!-- END -->

</Project>
```

3. You can now use the Aptos SDK in your Godot project.

```csharp
using Aptos;

public partial class MyClass : Node
{
public override void _Ready()
{
var client = new AptosClient(Networks.Mainnet);
var ledgerInfo = await client.Block.GetLedgerInfo();
Console.WriteLine($"Ledger Block Height: {ledgerInfo.BlockHeight}");
}
}
```

## Usage

Expand Down

0 comments on commit a240fb6

Please sign in to comment.