Skip to content

Commit

Permalink
Reworked to add unity package support and nuget publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidumanskiy committed Jun 24, 2024
1 parent 5da3b70 commit 3027ba2
Show file tree
Hide file tree
Showing 45 changed files with 132 additions and 9 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish

on:
release:
types: [published]

jobs:
deploy-upm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://upm.fenrirserver.org/

- run: npm publish
working-directory: source/UnityPackage/Assets
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

deploy-nuget:
runs-on: ubuntu-latest
defaults:
run:
working-directory: source
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.0.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore

- name: Test
run: dotnet test -c Release --no-build --verbosity normal -p:ParallelizeTestCollections=false

- name: Build solution and generate NuGet package
run: dotnet pack Fenrir.FixedMath -c Release

- name: Push generated package to NuGet
run: dotnet nuget push ./Fenrir.FixedMath/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: source
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal -p:ParallelizeTestCollections=false
7 changes: 0 additions & 7 deletions FixedMath/FixedMath.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fixed Math Library
# Fixed Math Library for C# (.NET and Unity)

A deterministic fixed-math library based on [FixedMath.Net](https://github.com/asik/FixedMath.Net/) and [MonoGame](https://github.com/MonoGame/MonoGame) Math structures.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions source/FixedMath/FixedMath.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Deterministic fixed-math library based on FixedMath.Net and MonoGame Math structures</Description>
<Version>1.0.0</Version>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\UnityPackage\Assets\Runtime\**\*.cs" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions source/UnityPackage/Assets/Runtime/Fenrir.FixedMath.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Fenrir.FixedMath",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions source/UnityPackage/Assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "org.fenrirserver.fixedmath",
"displayName": "Fenrir Fixed Math",
"description": "A deterministic fixed-math library based on FixedMath.Net and MonoGame Math structures.",
"license": "MIT",
"version": "1.0.0",
"author": {
"name": "Fenrir",
"email": "[email protected]",
"url": "https://fenrirserver.com"
},
"unity": "2018.3",
"dependencies": {
}
}
9 changes: 9 additions & 0 deletions source/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="defaultPushSource" value="https://api.nuget.org/v3/index.json" />
</config>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

0 comments on commit 3027ba2

Please sign in to comment.