Skip to content

Commit 717a3ef

Browse files
LordLuceusclaude
andcommitted
feat: Add GitHub Actions workflow for NuGet trusted publishing and CLAUDE.md
Add CI/CD pipeline that builds on push/PR and publishes to NuGet on version tags using OIDC-based trusted publishing (no long-lived API keys required). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0285a80 commit 717a3ef

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v5
22+
with:
23+
dotnet-version: 8.0.x
24+
25+
- name: Restore dependencies
26+
run: dotnet restore
27+
28+
- name: Build
29+
run: dotnet build --configuration Release --no-restore
30+
31+
- name: Pack
32+
run: dotnet pack --configuration Release --no-build --output ./artifacts
33+
34+
- name: Upload artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: nuget-packages
38+
path: ./artifacts/*.nupkg
39+
40+
- name: NuGet login (OIDC)
41+
if: startsWith(github.ref, 'refs/tags/v')
42+
uses: NuGet/login@v1
43+
id: nuget-login
44+
with:
45+
user: ${{ secrets.NUGET_USER }}
46+
47+
- name: Push to NuGet
48+
if: startsWith(github.ref, 'refs/tags/v')
49+
shell: pwsh
50+
run: |
51+
Get-ChildItem ./artifacts -Filter *.nupkg | ForEach-Object {
52+
dotnet nuget push $_.FullName `
53+
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" `
54+
--source https://api.nuget.org/v3/index.json `
55+
--skip-duplicate
56+
}

CLAUDE.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
MelonAccessibilityLib is a C# library that adds screen reader accessibility to Unity games via MelonLoader mods. It provides speech management, text cleaning utilities, and P/Invoke wrappers for UniversalSpeech with SAPI fallback.
8+
9+
## Build Commands
10+
11+
```bash
12+
# Build all target frameworks (net6.0, net472, net35)
13+
dotnet build
14+
15+
# Build specific framework
16+
dotnet build -f net6.0
17+
dotnet build -f net472
18+
dotnet build -f net35
19+
20+
# Release build
21+
dotnet build -c Release
22+
23+
# Create NuGet package
24+
dotnet pack -c Release
25+
```
26+
27+
Build outputs are located at `bin/{Debug|Release}/{net6.0|net472|net35}/MelonAccessibilityLib.dll`.
28+
29+
## Testing
30+
31+
No test framework is currently configured. If adding tests, use standard `dotnet test` commands.
32+
33+
## Architecture
34+
35+
### Component Overview
36+
37+
- **SpeechManager** (`SpeechManager.cs`): High-level static API for speech output with duplicate prevention, repeat functionality, and text formatting
38+
- **UniversalSpeechWrapper** (`UniversalSpeechWrapper.cs`): Low-level P/Invoke wrapper for UniversalSpeech.dll with SAPI fallback
39+
- **TextCleaner** (`TextCleaner.cs`): Removes Unity rich text tags and normalizes text for screen reader output
40+
- **AccessibilityLog/IAccessibilityLogger** (`IAccessibilityLogger.cs`): Logging facade with pluggable logger interface
41+
- **Net35Extensions** (`Net35Extensions.cs`): Polyfills for .NET 3.5 compatibility (e.g., `IsNullOrWhiteSpace`)
42+
43+
### Data Flow
44+
45+
```
46+
Consumer (MelonMod)
47+
48+
├─ Sets AccessibilityLog.Logger
49+
├─ Calls SpeechManager.Initialize()
50+
└─ Calls SpeechManager.Output()
51+
52+
├─ Duplicate suppression (time-based)
53+
├─ TextCleaner.Clean() (strips rich text)
54+
└─ UniversalSpeechWrapper.Speak() (P/Invoke)
55+
```
56+
57+
### Extensibility Points
58+
59+
- **Custom Logger**: Implement `IAccessibilityLogger` interface
60+
- **Text Formatting**: Set `SpeechManager.FormatTextOverride` delegate
61+
- **Repeat Logic**: Set `SpeechManager.ShouldStoreForRepeatPredicate` delegate
62+
- **Custom Text Types**: Use constants starting from `TextType.CustomBase` (100)
63+
64+
## Key Conventions
65+
66+
- All public classes are static (no instance creation)
67+
- Private fields use `_camelCase` prefix
68+
- P/Invoke constants use `ALL_CAPS`
69+
- Single namespace: `MelonAccessibilityLib`
70+
- Comprehensive XML documentation on all public members
71+
- Multi-target build: net35 is limited to C# 7.3 features
72+
73+
## Platform Requirements
74+
75+
- Windows only (P/Invoke and SAPI are Windows-specific)
76+
- UniversalSpeech.dll must be deployed alongside consuming mod
77+
- Supports screen readers: NVDA, JAWS, Window-Eyes, System Access, Supernova, ZoomText

0 commit comments

Comments
 (0)