diff --git a/.github/version.yml b/.github/version.yml new file mode 100644 index 0000000..a013f09 --- /dev/null +++ b/.github/version.yml @@ -0,0 +1,6 @@ +mode: ContinuousDeployment +branches: + master: + tag: beta + hotfix: + tag: useBranchName \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..992e665 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,93 @@ +name: Continuous Deployment + +on: + push: + tags: + - "*" + +jobs: + calculate-version: + name: Calculate Version + runs-on: ubuntu-latest + outputs: + semVer: ${{ steps.gitversion.outputs.semVer }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.11.0 + with: + versionSpec: "5.x" + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.11.0 + with: + useConfigFile: true + configFilePath: ./.github/version.yml + + build: + name: Build and Release + runs-on: windows-latest + needs: calculate-version + env: + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + SEMVER: ${{ needs.calculate-version.outputs.semVer }} + ZipName: NFive.SDK.Core-${{ needs.calculate-version.outputs.semVer }}.zip + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 2.0.x + + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}\.nuget\packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore dependencies + run: dotnet restore NFive.SDK.Core.sln + + - name: Build the solution + run: dotnet build --no-restore -c Release -o Build /p:Version=${{env.SEMVER}} NFive.SDK.Core.sln + + - uses: vimtor/action-zip@v1 + with: + files: Build/ + dest: ${{ env.ZipName }} + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.SEMVER }} + release_name: ${{ env.SEMVER }} + draft: false + prerelease: false + + - name: Update release asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: .\${{ env.ZipName }} + asset_name: ${{ env.ZipName }} + asset_content_type: application/zip + + - name: Pack + run: dotnet pack NFive.SDK.Core.csproj -p:PackageVersion=${{ env.SEMVER }} --configuration Release + + - name: Push nuget package + run: dotnet nuget push **/*.nupkg --skip-duplicate --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.nuget_api_key }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8b28cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: Continuous Integration + +on: + push: + branches: + - "**" + tags: + - "v*.*.*" + pull_request: + branches: + - "**" + +jobs: + calculate-version: + name: Calculate Version + runs-on: ubuntu-latest + outputs: + semVer: ${{ steps.gitversion.outputs.semVer }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.11.0 + with: + versionSpec: "5.x" + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.11.0 + with: + useConfigFile: true + configFilePath: ./.github/version.yml + + build: + runs-on: windows-latest + needs: calculate-version + env: + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + SEMVER: ${{ needs.calculate-version.outputs.semVer }} + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 2.0.x + + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}\.nuget\packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore dependencies + run: dotnet restore NFive.SDK.Core.sln + + - name: Build the solution + run: dotnet build --no-restore -c Release -o Build /p:Version=${{env.SEMVER}} NFive.SDK.Core.sln + + - name: Attach Zip as build artifact + uses: actions/upload-artifact@v4 + with: + name: NFive.SDK.Core-${{ env.SEMVER }} + path: Build \ No newline at end of file diff --git a/Configuration/LocaleConfiguration.cs b/Configuration/LocaleConfiguration.cs index b597664..83656e1 100644 --- a/Configuration/LocaleConfiguration.cs +++ b/Configuration/LocaleConfiguration.cs @@ -1,7 +1,7 @@ +using JetBrains.Annotations; using System; using System.Collections.Generic; using System.Globalization; -using JetBrains.Annotations; namespace NFive.SDK.Core.Configuration { diff --git a/Configuration/SteamId.cs b/Configuration/SteamId.cs index 50c8bc4..7276bb4 100644 --- a/Configuration/SteamId.cs +++ b/Configuration/SteamId.cs @@ -1,5 +1,5 @@ -using System; using JetBrains.Annotations; +using System; namespace NFive.SDK.Core.Configuration { diff --git a/NFive.SDK.Core.csproj b/NFive.SDK.Core.csproj index 78b1ecb..d46d3a0 100644 --- a/NFive.SDK.Core.csproj +++ b/NFive.SDK.Core.csproj @@ -1,93 +1,49 @@ - - - + + - Debug - AnyCPU - {C1DE80C7-579E-4D48-AAB8-37F5C1484F86} - Library - Properties + net471 NFive.SDK.Core NFive.SDK.Core.net - v4.5.2 - 512 - - .allowedextension - - - - false - none - false - bin\Debug - DEBUG;TRACE - prompt - 4 - - - false - none - true - bin\Release - TRACE - prompt - 4 + NFive.SDK.Core + NFive + NFive + LGPL-3.0-only + nfive fivem gtav + false + https://github.com/NFive/SDK.Core + git + NFive Core SDK for plugins + NFive.SDK.Core + https://github.com/NFive + icon.png + nfive fivem gtav + 0.1.4 + NFive core SDK for plugin development + README.md + Copyright © NFive 2018-2024 + en-US + - - packages\JetBrains.Annotations.2021.2.0\lib\net20\JetBrains.Annotations.dll - False - - - packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - False - - - + + True + \ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + True + \ + + - + + + + + $(PkgNewtonsoft_Json)\lib\portable-net40+sl5+win8+wp8+wpa81\Newtonsoft.Json.dll + - \ No newline at end of file diff --git a/NFive.SDK.Core.nuspec b/NFive.SDK.Core.nuspec deleted file mode 100644 index f6a6be3..0000000 --- a/NFive.SDK.Core.nuspec +++ /dev/null @@ -1,17 +0,0 @@ - - - - NFive.SDK.Core - $version$ - $title$ - NFive - NFive - false - LGPL-3.0-only - https://github.com/NFive/SDK.Core - $description$ - $copyright$ - nfive fivem gtav - - - diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs deleted file mode 100644 index ed5dc08..0000000 --- a/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NFive Core SDK")] -[assembly: AssemblyDescription("NFive core SDK for plugin development")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("NFive")] -[assembly: AssemblyProduct("NFive SDK")] -[assembly: AssemblyCopyright("Copyright © NFive 2018-2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("1ed39a02-e017-407d-8d32-fee8a1e29264")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0.0")] diff --git a/README.md b/README.md index e95609b..e05656c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NFive Core SDK [![License](https://img.shields.io/github/license/NFive/SDK.Core.svg)](LICENSE) -[![Build Status](https://img.shields.io/appveyor/ci/NFive/sdk-core.svg)](https://ci.appveyor.com/project/NFive/sdk-core) -[![NuGet Version](https://img.shields.io/nuget/v/NFive/SDK.Core.svg)](https://www.nuget.org/packages/NFive.SDK.Core) +[![Build Status](https://img.shields.io/github/actions/workflow/status/NFive/SDK.Core/ci.yml)](https://github.com/NFive/SDK.Core/actions/workflows/ci.yml) +[![NuGet Version](https://img.shields.io/nuget/v/NFive.SDK.Core)](https://www.nuget.org/packages/NFive.SDK.Core/) [![Release Version](https://img.shields.io/github/release/NFive/SDK.Core/all.svg)](https://github.com/NFive/SDK.Core/releases) [NFive](https://nfive.io/) SDK for developing plugins. diff --git a/StringValueAttribute.cs b/StringValueAttribute.cs new file mode 100644 index 0000000..a96dffe --- /dev/null +++ b/StringValueAttribute.cs @@ -0,0 +1,35 @@ +using System; + +namespace NFive.SDK.Core +{ + /// + /// This attribute is used to represent a string value + /// for a value in an enum. + /// + public class StringValueAttribute : Attribute + { + + #region Properties + + /// + /// Holds the string value for a value in an enum. + /// + public string StringValue { get; protected set; } + + #endregion + + #region Constructor + + /// + /// Constructor used to init a StringValue Attribute + /// + /// + public StringValueAttribute(string value) + { + this.StringValue = value; + } + + #endregion + + } +} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 978032c..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: 0.1.0.{build} - -image: Visual Studio 2019 -configuration: Release -platform: Any CPU -clone_depth: 1 - -branches: - only: - - master - -cache: -- packages -> packages.config - -test: off - -assembly_info: - patch: true - file: Properties\AssemblyInfo.cs - assembly_version: "{version}" - assembly_file_version: "{version}" - assembly_informational_version: "{version}" - -before_build: -- nuget update -self -- nuget restore - -build: - project: NFive.SDK.Core.sln - verbosity: minimal - publish_nuget: true diff --git a/images/icon.png b/images/icon.png new file mode 100644 index 0000000..1d2da72 Binary files /dev/null and b/images/icon.png differ diff --git a/packages.config b/packages.config deleted file mode 100644 index 22cb545..0000000 --- a/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file