Skip to content

Commit a7b0323

Browse files
Merge branch 'develop'
2 parents 3b23a65 + 049b403 commit a7b0323

30 files changed

+570
-247
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
branches: [ develop, main ]
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
11+
env:
12+
Solution: "src/CleanMyPosts.sln"
13+
UnitTest_Project: "src/UnitTests/UnitTests.csproj"
14+
IntegrationTest_Project: "src/IntegrationTests/IntegrationTests.csproj"
15+
FORCE_COLOR: "true"
16+
DOTNET_LOGGING__CONSOLE__COLORBEHAVIOR: Enabled
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: 9.x
28+
29+
- name: Install .NET Tools (local)
30+
run: |
31+
dotnet new tool-manifest
32+
dotnet tool install dotnet-reportgenerator-globaltool
33+
dotnet tool install dotnet-sonarscanner
34+
35+
- name: Restore
36+
run: dotnet restore "${{ env.Solution }}"
37+
38+
- name: Build and Test with SonarQube
39+
env:
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
41+
run: |
42+
dotnet tool run dotnet-sonarscanner begin `
43+
/k:"thorstenalpers_CleanMyPosts" `
44+
/o:"thorstenalpers" `
45+
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
46+
/d:sonar.host.url="https://sonarcloud.io" `
47+
/d:sonar.sources="src" `
48+
/d:sonar.tests="src/UnitTests;src/IntegrationTests" `
49+
/d:sonar.test.inclusions="**/*Tests.cs" `
50+
/d:sonar.coverageReportPaths="TestResults/Reports/SonarQube.xml"
51+
52+
dotnet build "${{ env.Solution }}" --configuration Release --no-restore
53+
54+
# Run Unit Tests
55+
dotnet test "${{ env.UnitTest_Project }}" `
56+
--collect:"XPlat Code Coverage" `
57+
--results-directory TestResults/UnitTests `
58+
--configuration Release `
59+
--logger "console;verbosity=detailed" `
60+
--filter "TestCategory!=Long-Running"
61+
62+
# Run Integration Tests
63+
dotnet test "${{ env.IntegrationTest_Project }}" `
64+
--collect:"XPlat Code Coverage" `
65+
--results-directory TestResults/IntegrationTests `
66+
--configuration Release `
67+
--logger "console;verbosity=detailed"
68+
69+
# Generate coverage reports
70+
dotnet tool run reportgenerator `
71+
-reports:TestResults/**/coverage.cobertura.xml `
72+
-targetdir:TestResults/Reports `
73+
-reporttypes:"Html;lcov;SonarQube;Cobertura" `
74+
75+
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
76+
77+
- name: Upload to Coveralls
78+
uses: coverallsapp/github-action@v2
79+
with:
80+
path-to-lcov: TestResults/Reports/lcov.info
81+
env:
82+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
83+
84+
- name: Upload Test Coverage Report
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: test-coverage-report
88+
path: TestResults/Reports
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: "Deploy Release"
2+
3+
on:
4+
workflow_dispatch: # manual trigger
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
10+
env:
11+
Solution: "src/CleanMyPosts.sln"
12+
UI_Project: "src/UI/UI.csproj"
13+
UnitTest_Project: "src/UnitTests/UnitTests.csproj"
14+
IntegrationTest_Project: "src/IntegrationTests/IntegrationTests.csproj"
15+
Installer_Script: "installer/Installer.iss"
16+
FORCE_COLOR: "true"
17+
DOTNET_LOGGING__CONSOLE__COLORBEHAVIOR: Enabled
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Important to fetch full history for git tag and branches
24+
25+
- name: Install .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: 9.x
29+
30+
- name: Restore
31+
run: dotnet restore "${{ env.Solution }}"
32+
33+
- name: Build
34+
run: dotnet build "${{ env.Solution }}" --configuration Release --no-restore
35+
36+
- name: Run Unit Tests
37+
run: dotnet test "${{ env.UnitTest_Project }}" --configuration Release --logger "console;verbosity=detailed" --filter "TestCategory!=Long-Running"
38+
39+
- name: Run Integration Tests
40+
run: dotnet test "${{ env.IntegrationTest_Project }}" --configuration Release --logger "console;verbosity=detailed"
41+
42+
- name: Extract Version
43+
id: get_version
44+
shell: pwsh
45+
run: |
46+
$content = Get-Content "${{ env.UI_Project }}"
47+
if ($content -match '<Version>(.+)</Version>') {
48+
$version = $matches[1]
49+
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
50+
} else {
51+
throw "Version not found in project file"
52+
}
53+
54+
- name: Publish Single EXE
55+
run: |
56+
dotnet publish "${{ env.UI_Project }}" -c Release -r win-x64 --self-contained true `
57+
/p:PublishSingleFile=true `
58+
/p:IncludeAllContentForSelfExtract=true `
59+
/p:EnableCompressionInSingleFile=true `
60+
-o artifacts/single-exe
61+
62+
- name: Install Inno Setup
63+
run: choco install innosetup --yes
64+
65+
- name: Build Setup EXE
66+
run: |
67+
iscc "/DMyAppVersion=${{ env.VERSION }}" "/DMyAppExePath=artifacts\\single-exe\\*" "${{ env.Installer_Script }}"
68+
69+
- name: Copy Setup EXE to Artifacts
70+
run: |
71+
mkdir -p artifacts/setup
72+
copy installer\Output\CleanMyPosts-Setup-${{ env.VERSION }}.exe artifacts\setup\
73+
74+
- name: Rename Standalone EXE for Release
75+
run: |
76+
Rename-Item "artifacts/single-exe/CleanMyPosts.exe" "artifacts/single-exe/CleanMyPosts-standalone.exe"
77+
78+
- name: Generate update.xml
79+
shell: pwsh
80+
run: |
81+
$version = "${{ env.VERSION }}"
82+
$repo = "${{ github.repository }}"
83+
$baseUrl = "https://github.com/$repo/releases/download/v$version"
84+
$installerUrl = "$baseUrl/CleanMyPosts-Setup-$version.exe"
85+
$changelogUrl = "https://github.com/$repo/releases/tag/v$version"
86+
$xmlContent = @"
87+
<?xml version='1.0' encoding='utf-8'?>
88+
<updates>
89+
<application>
90+
<name>CleanMyPosts</name>
91+
<version>$version</version>
92+
<url>$installerUrl</url>
93+
<changelog>$changelogUrl</changelog>
94+
</application>
95+
</updates>
96+
"@
97+
$xmlContent | Set-Content -Path "artifacts/update.xml" -Encoding UTF8
98+
99+
- name: Configure Git Credentials
100+
run: |
101+
echo "https://${{ secrets.GH_APIKEY }}@github.com" > $env:USERPROFILE\.git-credentials
102+
git config --global credential.helper store
103+
git config --global user.name "github-actions"
104+
git config --global user.email "[email protected]"
105+
106+
- name: Push update.xml to update-feed branch
107+
run: |
108+
git fetch origin update-feed || echo "No update-feed branch yet"
109+
if git show-ref --verify --quiet refs/heads/update-feed; then
110+
git checkout update-feed
111+
else
112+
git checkout --orphan update-feed
113+
git rm -rf .
114+
fi
115+
116+
cp artifacts/update.xml update.xml
117+
git add update.xml
118+
119+
if git diff --cached --quiet; then
120+
echo "No changes in update.xml; skipping commit"
121+
else
122+
git commit -m "Update appcast for version ${{ env.VERSION }}"
123+
git push origin update-feed --force
124+
fi
125+
126+
- name: Create Git Tag
127+
run: |
128+
git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
129+
git push origin "v${{ env.VERSION }}"
130+
131+
- name: Create GitHub Release
132+
uses: softprops/action-gh-release@v1
133+
with:
134+
tag_name: "v${{ env.VERSION }}"
135+
name: "CleanMyPosts ${{ env.VERSION }}"
136+
body_path: ./release-notes/v${{ env.VERSION }}.md
137+
files: |
138+
artifacts/single-exe/CleanMyPosts-standalone.exe
139+
artifacts/setup/CleanMyPosts-Setup-${{ env.VERSION }}.exe
140+
artifacts/update.xml
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
# CleanMyPosts
1+
![Banner](./src/UI/Assets/banner.png)
2+
3+
4+
[![Windows](https://img.shields.io/badge/platform-Windows-blue)](#)
5+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE.txt)
6+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=thorstenalpers_CleanMyPosts&metric=alert_status)](https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=thorstenalpers_CleanMyPosts)
7+
[![CI Tests](https://github.com/thorstenalpers/CleanMyPosts/actions/workflows/ci.yml/badge.svg)](https://github.com/thorstenalpers/CleanMyPosts/actions/workflows/ci.yml)
8+
[![Coverage Status](https://coveralls.io/repos/github/thorstenalpers/CleanMyPosts/badge.svg?branch=develop)](https://coveralls.io/github/thorstenalpers/CleanMyPosts?branch=develop)
9+
[![Star this repo](https://img.shields.io/github/stars/thorstenalpers/CleanMyPosts.svg?style=social&label=Star&maxAge=60)](https://github.com/thorstenalpers/CleanMyPosts)
10+
211

312
> ⚠️ **Warning:** Development in progress – the application has not been released.
413
@@ -21,7 +30,7 @@
2130
* bookmark bar, hideable via settings
2231

2332

24-
# 🧹 CleanMyPosts
33+
---
2534

2635
**CleanMyPosts** is a lightweight Windows desktop application that securely deletes all tweets from your X (formerly Twitter) account in bulk. Designed for privacy-focused users, social media managers, or anyone looking to start fresh.
2736

installer/Installer.iss

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
1-
; Script generated by the Inno Setup Script Wizard.
2-
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3-
41
#define MyAppName "CleanMyPosts"
5-
#define MyAppVersion "0.0.1"
62
#define MyAppPublisher "Thorsten Alpers"
73
#define MyAppURL "https://github.com/thorstenalpers/CleanMyPosts"
84
#define MyAppExeName "CleanMyPosts.exe"
95
#define MyIconPath "..\src\UI\Assets\logo.ico"
10-
#define MyAppExePath "..\src\UI\bin\Release\net9.0-windows10.0.19041.0\win-x64\publish\*"
6+
7+
; dynamically set in github actions, ifndef use local values
8+
#ifndef MyAppVersion
9+
#define MyAppVersion "0.0.1"
10+
#endif
11+
#ifndef MyAppExePath
12+
#define MyAppExePath "..\src\UI\bin\Release\net9.0-windows10.0.19041.0\win-x64\publish\*"
13+
#endif
1114

1215
[Setup]
13-
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
14-
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
1516
AppId={{AEE32610-58A5-4785-98B0-B651865B30D2}}
1617
AppName={#MyAppName}
1718
AppVersion={#MyAppVersion}
18-
;AppVerName={#MyAppName} {#MyAppVersion}
1919
AppPublisher={#MyAppPublisher}
2020
AppPublisherURL={#MyAppURL}
2121
AppSupportURL={#MyAppURL}
2222
AppUpdatesURL={#MyAppURL}
2323
DefaultDirName={autopf}\{#MyAppName}
2424
UninstallDisplayIcon={app}\{#MyAppExeName}
25-
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
26-
; on anything but x64 and Windows 11 on Arm.
2725
ArchitecturesAllowed=x64compatible
28-
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
29-
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
30-
; meaning it should use the native 64-bit Program Files directory and
31-
; the 64-bit view of the registry.
3226
ArchitecturesInstallIn64BitMode=x64compatible
3327
DisableProgramGroupPage=yes
34-
; Uncomment the following line to run in non administrative install mode (install for current user only).
3528
PrivilegesRequired=admin
36-
; PrivilegesRequiredOverridesAllowed=no
37-
OutputBaseFilename=CleanMyPosts_Setup_{#MyAppVersion}
29+
OutputBaseFilename=CleanMyPosts-Setup-{#MyAppVersion}
3830
SolidCompression=yes
3931
WizardStyle=modern
4032
SetupIconFile={#MyIconPath}
@@ -49,13 +41,10 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
4941
Source: "{#MyAppExePath}"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
5042
Source: "{#MyIconPath}"; DestDir: "{app}"; Flags: ignoreversion
5143

52-
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
53-
5444
[Icons]
5545
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"
5646
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"; Tasks: desktopicon
5747

58-
5948
[Run]
6049
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
6150

release-notes/v0.0.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### What's Changed
2+
3+
* First Release

src/CleanMyPosts.sln

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "UI\UI.csproj", "{48A1
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{A65F1C77-11C1-DC4F-0A69-6EE789D29685}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{F7B3E70B-3487-8FDC-C91B-9CA0F0F66BE0}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{F7B3E70B-3487-8FDC-C91B-9CA0F0F66BE0}"
1111
EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
1313
ProjectSection(SolutionItems) = preProject
@@ -19,6 +19,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1919
..\README.md = ..\README.md
2020
EndProjectSection
2121
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "IntegrationTests\IntegrationTests.csproj", "{59FDAA84-6701-32D0-9E5C-CA30D0B3B987}"
23+
EndProject
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
25+
ProjectSection(SolutionItems) = preProject
26+
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
27+
..\.github\workflows\deploy-release.yml = ..\.github\workflows\deploy-release.yml
28+
EndProjectSection
29+
EndProject
2230
Global
2331
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2432
Debug|Any CPU = Debug|Any CPU
@@ -37,10 +45,17 @@ Global
3745
{F7B3E70B-3487-8FDC-C91B-9CA0F0F66BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
3846
{F7B3E70B-3487-8FDC-C91B-9CA0F0F66BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
3947
{F7B3E70B-3487-8FDC-C91B-9CA0F0F66BE0}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{59FDAA84-6701-32D0-9E5C-CA30D0B3B987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{59FDAA84-6701-32D0-9E5C-CA30D0B3B987}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{59FDAA84-6701-32D0-9E5C-CA30D0B3B987}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{59FDAA84-6701-32D0-9E5C-CA30D0B3B987}.Release|Any CPU.Build.0 = Release|Any CPU
4052
EndGlobalSection
4153
GlobalSection(SolutionProperties) = preSolution
4254
HideSolutionNode = FALSE
4355
EndGlobalSection
56+
GlobalSection(NestedProjects) = preSolution
57+
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}
58+
EndGlobalSection
4459
GlobalSection(ExtensibilityGlobals) = postSolution
4560
SolutionGuid = {C5A00240-64B9-4718-9682-317A36915078}
4661
EndGlobalSection
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
<AssetTargetFallback>uap10.0.18362</AssetTargetFallback>
7+
<Platforms>x64;x86;AnyCPU</Platforms>
8+
<RootNamespace>CleanMyPosts.IntegrationTests</RootNamespace>
9+
<DefaultNamespace>CleanMyPosts.IntegrationTests</DefaultNamespace>
10+
<AssemblyName>CleanMyPosts.IntegrationTests</AssemblyName>
11+
<ImplicitUsings>enable</ImplicitUsings>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="coverlet.collector" Version="6.0.4">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageReference>
19+
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
23+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
24+
<PackageReference Include="Moq" Version="4.20.72" />
25+
<PackageReference Include="NUnit" Version="4.3.2" />
26+
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<ProjectReference Include="..\UI\UI.csproj" />
31+
</ItemGroup>
32+
33+
</Project>

0 commit comments

Comments
 (0)