Skip to content

Commit d9fac04

Browse files
committed
Initial release
This is the initial public release of MintedTextEditor — a high-performance, fully custom-drawn rich text editor for .NET MAUI, rendered entirely via SkiaSharp with no native text control wrapping.
0 parents  commit d9fac04

306 files changed

Lines changed: 29488 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: CI
2+
3+
"on":
4+
push:
5+
branches: [main, develop]
6+
paths-ignore:
7+
- '**.md'
8+
- 'docs/**'
9+
pull_request:
10+
branches: [main, develop]
11+
paths-ignore:
12+
- '**.md'
13+
- 'docs/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
# ── Job 1: Build & Test (Core + SkiaSharp) ──────────────────────────────────
21+
build-and-test:
22+
name: Build & Test (Core + SkiaSharp)
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # full history required for SourceLink
30+
31+
- name: Setup .NET 10
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: '10.x'
35+
36+
- name: Restore
37+
run: |
38+
dotnet restore src/MintedTextEditor.Core/
39+
dotnet restore src/MintedTextEditor.SkiaSharp/
40+
dotnet restore tests/MintedTextEditor.Core.Tests/
41+
42+
- name: Build
43+
run: |
44+
dotnet build src/MintedTextEditor.Core/ --no-restore --configuration Release
45+
dotnet build src/MintedTextEditor.SkiaSharp/ --no-restore --configuration Release
46+
dotnet build tests/MintedTextEditor.Core.Tests/ --no-restore --configuration Release
47+
48+
- name: Test
49+
run: >
50+
dotnet test tests/MintedTextEditor.Core.Tests/
51+
--no-build
52+
--configuration Release
53+
--logger "trx;LogFileName=test-results.trx"
54+
--results-directory ./test-results
55+
56+
- name: Upload test results
57+
uses: actions/upload-artifact@v4
58+
if: always()
59+
with:
60+
name: test-results
61+
path: ./test-results/*.trx
62+
63+
- name: Pack dry-run (Core)
64+
run: >
65+
dotnet pack src/MintedTextEditor.Core/MintedTextEditor.Core.csproj
66+
--no-build
67+
--configuration Release
68+
--output ./packages
69+
70+
- name: Pack dry-run (SkiaSharp)
71+
run: >
72+
dotnet pack src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj
73+
--no-build
74+
--configuration Release
75+
--output ./packages
76+
77+
# ── Job 2: Build (MAUI) ─────────────────────────────────────────────────────
78+
build-maui:
79+
name: Build (MAUI)
80+
runs-on: windows-latest
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
with:
86+
fetch-depth: 0
87+
88+
- name: Setup .NET 10
89+
uses: actions/setup-dotnet@v4
90+
with:
91+
dotnet-version: '10.x'
92+
93+
- name: Cache MAUI workloads
94+
uses: actions/cache@v4
95+
id: maui-cache
96+
with:
97+
path: |
98+
~/.dotnet/workloads
99+
~/.nuget/packages
100+
key: maui-workloads-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
101+
restore-keys: maui-workloads-${{ runner.os }}-
102+
103+
- name: Install MAUI workloads
104+
if: steps.maui-cache.outputs.cache-hit != 'true'
105+
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
106+
107+
- name: Restore
108+
run: dotnet restore src/MintedTextEditor.Maui/
109+
110+
- name: Build
111+
run: >
112+
dotnet build src/MintedTextEditor.Maui/
113+
--no-restore
114+
--configuration Release
115+
116+
- name: Pack dry-run (MAUI)
117+
run: >
118+
dotnet pack src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
119+
--no-build
120+
--configuration Release
121+
--output ./packages

.github/workflows/publish.yml

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
name: Publish
2+
3+
"on":
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Package version (e.g. 1.2.3 or 1.2.3-preview.1)'
11+
required: true
12+
13+
jobs:
14+
# ── Job 1: Pack Core & SkiaSharp ────────────────────────────────────────────
15+
pack-core:
16+
name: Pack Core & SkiaSharp
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # required for SourceLink
24+
25+
- name: Resolve version
26+
id: version
27+
run: |
28+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
29+
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
32+
fi
33+
34+
- name: Setup .NET 10
35+
uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '10.x'
38+
39+
- name: Restore
40+
run: |
41+
dotnet restore src/MintedTextEditor.Core/
42+
dotnet restore src/MintedTextEditor.SkiaSharp/
43+
44+
- name: Build
45+
run: |
46+
dotnet build src/MintedTextEditor.Core/ --no-restore --configuration Release /p:Version=${{ steps.version.outputs.version }}
47+
dotnet build src/MintedTextEditor.SkiaSharp/ --no-restore --configuration Release /p:Version=${{ steps.version.outputs.version }}
48+
49+
- name: Pack Core
50+
run: >
51+
dotnet pack src/MintedTextEditor.Core/MintedTextEditor.Core.csproj
52+
--no-build
53+
--configuration Release
54+
/p:Version=${{ steps.version.outputs.version }}
55+
--include-symbols
56+
-p:SymbolPackageFormat=snupkg
57+
--output ./packages
58+
59+
- name: Pack SkiaSharp
60+
run: >
61+
dotnet pack src/MintedTextEditor.SkiaSharp/MintedTextEditor.SkiaSharp.csproj
62+
--no-build
63+
--configuration Release
64+
/p:Version=${{ steps.version.outputs.version }}
65+
--include-symbols
66+
-p:SymbolPackageFormat=snupkg
67+
--output ./packages
68+
69+
- name: Upload .nupkg artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: packages-core
73+
path: ./packages/*.nupkg
74+
75+
- name: Upload .snupkg artifacts
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: symbol-packages-core
79+
path: ./packages/*.snupkg
80+
81+
# ── Job 2: Pack MAUI ────────────────────────────────────────────────────────
82+
pack-maui:
83+
name: Pack MAUI
84+
runs-on: windows-latest
85+
86+
steps:
87+
- name: Checkout
88+
uses: actions/checkout@v4
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Resolve version
93+
id: version
94+
shell: bash
95+
run: |
96+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
97+
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
98+
else
99+
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
100+
fi
101+
102+
- name: Setup .NET 10
103+
uses: actions/setup-dotnet@v4
104+
with:
105+
dotnet-version: '10.x'
106+
107+
- name: Cache MAUI workloads
108+
uses: actions/cache@v4
109+
id: maui-cache
110+
with:
111+
path: |
112+
~/.dotnet/workloads
113+
~/.nuget/packages
114+
key: maui-workloads-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
115+
restore-keys: maui-workloads-${{ runner.os }}-
116+
117+
- name: Install MAUI workloads
118+
if: steps.maui-cache.outputs.cache-hit != 'true'
119+
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
120+
121+
- name: Restore
122+
run: dotnet restore src/MintedTextEditor.Maui/
123+
124+
- name: Build
125+
run: >
126+
dotnet build src/MintedTextEditor.Maui/
127+
--no-restore
128+
--configuration Release
129+
/p:Version=${{ steps.version.outputs.version }}
130+
131+
- name: Pack MAUI
132+
run: >
133+
dotnet pack src/MintedTextEditor.Maui/MintedTextEditor.Maui.csproj
134+
--no-build
135+
--configuration Release
136+
/p:Version=${{ steps.version.outputs.version }}
137+
--include-symbols
138+
-p:SymbolPackageFormat=snupkg
139+
--output ./packages
140+
141+
- name: Upload .nupkg artifact
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: packages-maui
145+
path: ./packages/*.nupkg
146+
147+
- name: Upload .snupkg artifact
148+
uses: actions/upload-artifact@v4
149+
with:
150+
name: symbol-packages-maui
151+
path: ./packages/*.snupkg
152+
153+
# ── Job 3: Publish to NuGet.org ─────────────────────────────────────────────
154+
publish-nuget:
155+
name: Publish to NuGet.org
156+
needs: [pack-core, pack-maui]
157+
runs-on: ubuntu-latest
158+
159+
steps:
160+
- name: Download Core packages
161+
uses: actions/download-artifact@v4
162+
with:
163+
name: packages-core
164+
path: ./packages
165+
166+
- name: Download MAUI packages
167+
uses: actions/download-artifact@v4
168+
with:
169+
name: packages-maui
170+
path: ./packages
171+
172+
- name: Setup .NET 10
173+
uses: actions/setup-dotnet@v4
174+
with:
175+
dotnet-version: '10.x'
176+
177+
- name: Push to NuGet.org
178+
run: >
179+
dotnet nuget push "./packages/*.nupkg"
180+
--api-key ${{ secrets.NUGET_API_KEY }}
181+
--source https://api.nuget.org/v3/index.json
182+
--skip-duplicate
183+
184+
# ── Job 4: Create GitHub Release ────────────────────────────────────────────
185+
create-release:
186+
name: Create GitHub Release
187+
needs: [pack-core, pack-maui]
188+
runs-on: ubuntu-latest
189+
permissions:
190+
contents: write
191+
192+
steps:
193+
- name: Resolve version and tag
194+
id: version
195+
run: |
196+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
197+
VER="${{ github.event.inputs.version }}"
198+
echo "version=${VER}" >> "$GITHUB_OUTPUT"
199+
echo "tag=v${VER}" >> "$GITHUB_OUTPUT"
200+
else
201+
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
202+
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
203+
fi
204+
205+
- name: Download Core packages
206+
uses: actions/download-artifact@v4
207+
with:
208+
name: packages-core
209+
path: ./packages
210+
211+
- name: Download MAUI packages
212+
uses: actions/download-artifact@v4
213+
with:
214+
name: packages-maui
215+
path: ./packages
216+
217+
- name: Create release and attach packages
218+
uses: actions/github-script@v7
219+
with:
220+
script: |
221+
const fs = require('fs');
222+
const path = require('path');
223+
224+
const version = '${{ steps.version.outputs.version }}';
225+
const tag = '${{ steps.version.outputs.tag }}';
226+
const isPreRelease = version.includes('-');
227+
228+
const release = await github.rest.repos.createRelease({
229+
owner: context.repo.owner,
230+
repo: context.repo.repo,
231+
tag_name: tag,
232+
name: `MintedTextEditor v${version}`,
233+
generate_release_notes: true,
234+
draft: false,
235+
prerelease: isPreRelease,
236+
});
237+
238+
const packagesDir = './packages';
239+
const nupkgs = fs.readdirSync(packagesDir).filter(f => f.endsWith('.nupkg'));
240+
for (const file of nupkgs) {
241+
const filePath = path.join(packagesDir, file);
242+
const data = fs.readFileSync(filePath);
243+
await github.rest.repos.uploadReleaseAsset({
244+
owner: context.repo.owner,
245+
repo: context.repo.repo,
246+
release_id: release.data.id,
247+
name: file,
248+
data: data,
249+
headers: { 'content-type': 'application/zip' },
250+
});
251+
}

0 commit comments

Comments
 (0)