Skip to content
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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
pull_request:
push:
branches:
- dev
# publish.yml calls both jobs on the commit being published.
workflow_call:

permissions:
contents: read

jobs:
test-and-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore MajRadar.slnx

- name: Test default dependencies
run: dotnet test MajRadar.slnx --no-restore -c Release

- name: Verify package build
run: dotnet pack MajRadar.csproj --no-restore -c Release -o artifacts

- name: Upload CI package
uses: actions/upload-artifact@v4
with:
name: MajRadar-nuget
path: artifacts/*.nupkg
if-no-files-found: error

play-majsimai-pin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout pinned MajSimai
uses: actions/checkout@v4
with:
repository: TeamMajdata/MajSimai
ref: fdb2a3e39d8997a0abbf8b4679062d854473cc77
path: external/MajSimai
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore with pinned MajSimai
run: >-
dotnet restore MajRadar.slnx
-p:MajSimaiProject="$GITHUB_WORKSPACE/external/MajSimai/MajSimai.csproj"

- name: Test with pinned MajSimai
run: >-
dotnet test MajRadar.slnx --no-restore -c Release
-p:MajSimaiProject="$GITHUB_WORKSPACE/external/MajSimai/MajSimai.csproj"
86 changes: 86 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Publish NuGet

on:
push:
# main pushes publish preview packages; v* tags select an explicit version.
branches:
- main
tags:
- "v*"
workflow_dispatch:

permissions:
contents: read

jobs:
validate:
uses: ./.github/workflows/ci.yml

publish:
# Both CI jobs must pass before this job starts.
needs: validate
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- id: version
name: Select package version
shell: bash
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
value="${GITHUB_REF_NAME#v}"
else
prefix="$(dotnet msbuild MajRadar.csproj -nologo -getProperty:VersionPrefix)"
if [[ -z "$prefix" ]]; then
echo "::error::VersionPrefix is empty. Set it in MajRadar.csproj or Directory.Build.props."
exit 1
fi
value="${prefix}-ci.${GITHUB_RUN_NUMBER}"
fi
if [[ -z "$value" ]]; then
echo "::error::The version tag must contain a NuGet version after v."
exit 1
fi
echo "value=$value" >> "$GITHUB_OUTPUT"

- name: Restore
run: dotnet restore MajRadar.slnx

- name: Build release package
env:
PACKAGE_VERSION: ${{ steps.version.outputs.value }}
run: >-
dotnet pack MajRadar.csproj --no-restore -c Release -o artifacts
-p:PackageVersion="$PACKAGE_VERSION"

- name: Upload versioned package
uses: actions/upload-artifact@v4
with:
name: MajRadar-${{ steps.version.outputs.value }}
path: artifacts/*.nupkg
if-no-files-found: error

# Repository variable NUGET_USER is your nuget.org username, not email.
# Register this repository and publish.yml in NuGet Trusted Publishing.
- name: NuGet login
uses: NuGet/login@v1
id: nuget-login
with:
user: ${{ vars.NUGET_USER }}

- name: Publish package
env:
NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
# An existing version is skipped on rerun; it is never overwritten.
run: >-
dotnet nuget push "artifacts/*.nupkg"
--api-key "$NUGET_API_KEY"
--source https://api.nuget.org/v3/index.json
--skip-duplicate
65 changes: 13 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
# Recommended: add any editor/OS/tool-specific ignore rules from the Global/ templates as needed.
# See: https://github.com/github/gitignore/tree/main/Global
#
# Unity-generated directories
.utmp/
/[Ll]ibrary/
/[Tt]emp/
Expand All @@ -15,38 +9,19 @@
/[Uu]ser[Ss]ettings/
*.log

# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control.
*.blend1
*.blend1.meta

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

# Recordings can get excessive in size
/[Rr]ecordings/

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Jetbrains Rider personal-layer settings
*.DotSettings.user

# Visual Studio cache directory
# Editor and generated project state
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.slnx
*.suo
*.tmp
*.user
Expand All @@ -59,48 +34,34 @@ ExportedObj/
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Mono auto generated files
mono_crash.*

# Builds
# Unity build artifacts
*.apk
*.aab
*.unitypackage
*.unitypackage.meta
*.app

# Crashlytics generated file
crashlytics-build.properties

# TestRunner generated files
InitTestScene*.unity*

# Addressables default ignores, before user customizations
/ServerData
/[Aa]ssets/StreamingAssets/aa*
/[Aa]ssets/AddressableAssetsData/link.xml*
/[Aa]ssets/Addressables_Temp*
# By default, Addressables content builds will generate addressables_content_state.bin
# files in platform-specific subfolders, for example:
# /Assets/AddressableAssetsData/OSX/addressables_content_state.bin
/[Aa]ssets/AddressableAssetsData/*/*.bin*

# Visual Scripting auto-generated files
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers
/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers.meta

# Auto-generated scenes by play mode tests
/[Aa]ssets/VisualScripting.Generated/
/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*

# Auto-generated cache in Assets folder
/[Aa]ssets/[Ss]ceneDependencyCache*

# .NET build and test artifacts
bin/
obj/
TestResults/
artifacts/

# OS files
.DS_Store
9 changes: 9 additions & 0 deletions Documentation~/MajdataPlay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MajdataPlay integration

MajdataPlay should pin this repository as `Assets/Plugins/MajRadar` and keep its
existing `Assets/Plugins/MajSimai` pin. `MajRadar.asmdef` references that one
MajSimai assembly; the NuGet package is not installed into the Unity project.

Extended `K` Slides are resolved through `IExtendedSlideBarCountProvider`. The
sample provider calls Play's existing `SlideCodeParser` and `SlideDataBuilder`,
so MajRadar does not copy or depend on gameplay geometry.
32 changes: 32 additions & 0 deletions MajRadar.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<AssemblyName>MajRadar</AssemblyName>
<RootNamespace>MajRadar</RootNamespace>
<PackageId>TeamMajdata.MajRadar</PackageId>
<VersionPrefix>0.1.0</VersionPrefix>
<Authors>Team Majdata</Authors>
<Description>Radar analysis and constant estimation for Simai charts.</Description>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/TeamMajdata/MajRadar</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<Compile Include="Runtime/**/*.cs" />
</ItemGroup>
<ItemGroup Condition="'$(MajSimaiProject)' == ''">
<PackageReference Include="Lingfeng-bbben.MajSimai" Version="2.2.2" />
</ItemGroup>
<ItemGroup Condition="'$(MajSimaiProject)' != ''">
<ProjectReference Include="$(MajSimaiProject)" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions MajRadar.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Solution>
<Project Path="MajRadar.csproj" />
<Project Path="Tests~/MajRadar.Tests/MajRadar.Tests.csproj" />
</Solution>
Loading
Loading