Skip to content

Commit f6acaf2

Browse files
committed
Add changelog and workflows.
1 parent 59c8ca3 commit f6acaf2

8 files changed

Lines changed: 487 additions & 1 deletion

File tree

.github/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
github: tobitege # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
ko_fi: tobitege
5+
buy_me_a_coffee: tobitege23

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI Build
2+
3+
# Builds on every commit to verify everything compiles.
4+
# Does NOT publish anything - just verification.
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
build:
16+
runs-on: windows-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: '8.0.x'
23+
24+
- name: Build Solution
25+
run: dotnet build OpenSourceToolkit.Net.sln -c Release -p:UseLocalFlowery=false
26+

.github/workflows/release.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: Release
2+
3+
# MANUAL TRIGGER ONLY - Creates a new GitHub Release with desktop app artifacts.
4+
# Go to Actions → Release → Run workflow → Enter version (e.g., 0.1.0)
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (e.g., 0.1.0) - without "v" prefix'
11+
required: true
12+
type: string
13+
skip_tag:
14+
description: 'Skip tag creation (assumes you already pushed the tag manually)'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
jobs:
20+
validate:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
version: ${{ steps.validate.outputs.version }}
24+
tag: ${{ steps.validate.outputs.tag }}
25+
steps:
26+
- name: Validate version format
27+
id: validate
28+
run: |
29+
VERSION="${{ inputs.version }}"
30+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
31+
echo "::error::Invalid version format. Use semantic versioning (e.g., 0.1.0)"
32+
exit 1
33+
fi
34+
echo "version=$VERSION" >> $GITHUB_OUTPUT
35+
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
36+
echo "✅ Version: $VERSION, Tag: v$VERSION"
37+
38+
build-desktop:
39+
needs: validate
40+
runs-on: windows-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: actions/setup-dotnet@v4
46+
with:
47+
dotnet-version: '8.0.x'
48+
49+
- name: Publish Desktop App (win-x64)
50+
shell: pwsh
51+
run: |
52+
dotnet publish OpenSourceToolkit.NET/OpenSourceToolkit.NET.csproj `
53+
-c Release `
54+
-r win-x64 `
55+
--self-contained true `
56+
-p:PublishSingleFile=true `
57+
-p:IncludeNativeLibrariesForSelfExtract=true `
58+
-p:EnableCompressionInSingleFile=true `
59+
-p:UseLocalFlowery=false `
60+
-o ./publish
61+
62+
- name: Zip artifact
63+
shell: pwsh
64+
run: |
65+
$artifactName = "OpenSourceToolkit.NET-Desktop-Windows-x64"
66+
Compress-Archive -Path ./publish/* -DestinationPath "./$artifactName.zip"
67+
68+
- name: Upload desktop artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: OpenSourceToolkit.NET-Desktop-Windows-x64
72+
path: |
73+
./OpenSourceToolkit.NET-Desktop-Windows-x64.zip
74+
75+
publish:
76+
needs: [validate, build-desktop]
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: write
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Verify version in OpenSourceToolkit.NET.csproj
85+
run: |
86+
CSPROJ_VERSION=$(grep -oP '(?<=<Version>)[^<]+' OpenSourceToolkit.NET/OpenSourceToolkit.NET.csproj | head -n 1)
87+
if [ -z "$CSPROJ_VERSION" ]; then
88+
echo "::error::No <Version> found in OpenSourceToolkit.NET/OpenSourceToolkit.NET.csproj"
89+
exit 1
90+
fi
91+
if [ "$CSPROJ_VERSION" != "${{ needs.validate.outputs.version }}" ]; then
92+
echo "::error::Version mismatch! csproj has $CSPROJ_VERSION but you specified ${{ needs.validate.outputs.version }}"
93+
echo "::error::Please update OpenSourceToolkit.NET/OpenSourceToolkit.NET.csproj first!"
94+
exit 1
95+
fi
96+
echo "✅ Version matches: $CSPROJ_VERSION"
97+
98+
- name: Download all artifacts
99+
uses: actions/download-artifact@v4
100+
with:
101+
path: ./release-artifacts
102+
103+
- name: Collect artifacts
104+
run: |
105+
mkdir -p ./final
106+
find ./release-artifacts -name "*.zip" -exec cp {} ./final/ \;
107+
echo "=== Release artifacts ==="
108+
ls -la ./final/
109+
110+
- name: Extract changelog
111+
id: changelog
112+
run: |
113+
VERSION="${{ needs.validate.outputs.version }}"
114+
# Extract the section for this version from CHANGELOG.md
115+
# Matches from "## [X.Y.Z]" until the next "## [" or end of file
116+
CHANGELOG=$(awk -v ver="$VERSION" '
117+
/^## \[/ {
118+
if (found) exit
119+
if ($0 ~ "\\[" ver "\\]") found=1
120+
}
121+
found && !/^## \[/ { print }
122+
' CHANGELOG.md)
123+
124+
if [ -z "$CHANGELOG" ]; then
125+
echo "::error::No changelog entry found for version $VERSION in CHANGELOG.md"
126+
exit 1
127+
fi
128+
129+
# Write to file for multiline support
130+
echo "$CHANGELOG" > changelog_section.md
131+
echo "✅ Extracted changelog for v$VERSION"
132+
133+
- name: Create and push tag
134+
if: ${{ inputs.skip_tag != true }}
135+
run: |
136+
git config user.name "github-actions[bot]"
137+
git config user.email "github-actions[bot]@users.noreply.github.com"
138+
git tag ${{ needs.validate.outputs.tag }}
139+
git push origin ${{ needs.validate.outputs.tag }}
140+
echo "✅ Created tag: ${{ needs.validate.outputs.tag }}"
141+
142+
- name: Skip tag creation
143+
if: ${{ inputs.skip_tag == true }}
144+
run: echo "⏭️ Skipping tag creation (tag already exists)"
145+
146+
- name: Build release notes
147+
run: |
148+
cat > release_notes.md << 'HEADER'
149+
## 📋 What's Changed
150+
HEADER
151+
cat changelog_section.md >> release_notes.md
152+
cat >> release_notes.md << 'FOOTER'
153+
154+
---
155+
156+
FOOTER
157+
cat >> release_notes.md << 'APP'
158+
159+
## 🖥️ Desktop App (Windows)
160+
161+
Self-contained executable - no .NET installation required!
162+
163+
| Platform | Download |
164+
|----------|----------|
165+
| Windows x64 | `OpenSourceToolkit.NET-Desktop-Windows-x64.zip` |
166+
APP
167+
168+
echo "=== Release Notes ==="
169+
cat release_notes.md
170+
171+
- name: Load custom release notes
172+
id: release_body
173+
run: |
174+
{
175+
echo 'body<<EOF'
176+
cat release_notes.md
177+
echo ''
178+
echo 'EOF'
179+
} >> "$GITHUB_OUTPUT"
180+
181+
- name: Create GitHub Release
182+
uses: softprops/action-gh-release@v1
183+
with:
184+
tag_name: ${{ needs.validate.outputs.tag }}
185+
name: "v${{ needs.validate.outputs.version }}"
186+
files: ./final/*
187+
generate_release_notes: true
188+
body: ${{ steps.release_body.outputs.body }}
189+
env:
190+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
191+
192+
- name: Summary
193+
run: |
194+
echo "## 🎉 Release Complete!" >> $GITHUB_STEP_SUMMARY
195+
echo "" >> $GITHUB_STEP_SUMMARY
196+
echo "- **Version:** ${{ needs.validate.outputs.version }}" >> $GITHUB_STEP_SUMMARY
197+
echo "- **Tag:** ${{ needs.validate.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
198+
echo "- **Release:** ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.validate.outputs.tag }}" >> $GITHUB_STEP_SUMMARY

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Agent Rules
22

3-
- **Terminal Commands**: Always use `cmd /c` prefix for terminal commands to ensuring proper execution in the Windows environment.
43
- ONLY call `dotnet` commands if requested by user.
54

65
## Avalonia UI Rules

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2025-12-20
9+
10+
### Added
11+
12+
- Initial public release.

OpenSourceToolkit.NET/OpenSourceToolkit.NET.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
44
<TargetFramework>net8.0-windows</TargetFramework>
5+
<Version>0.1.0</Version>
6+
<AssemblyVersion>0.1.0.0</AssemblyVersion>
7+
<FileVersion>0.1.0.0</FileVersion>
58
<LangVersion>latest</LangVersion>
69
<ImplicitUsings>disable</ImplicitUsings>
710
<OutputPath Condition="'$(Configuration)'=='Debug'">..\bin\debug\</OutputPath>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Porting was mainly done by help of AI, but I spent hundreds of hours tweaking
1313
the tools, adding translations, add more features and simultaneously enhancing
1414
my [Flowery.NET component suite](https://github.com/tobitege/Flowery.NET) for the UI.
1515

16+
The total lines of code count (excluding comments) is > 400K.
17+
1618
<div align="center">
1719

1820
🌐 **Localized in 12 languages** including:

0 commit comments

Comments
 (0)