Skip to content

Commit a5bb686

Browse files
committed
chore: release version packages
1 parent ebff631 commit a5bb686

File tree

8 files changed

+118
-19
lines changed

8 files changed

+118
-19
lines changed

.github/workflows/main-release.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ jobs:
481481
releaseName: "mpesa2csv ${{ needs.prepare-release.outputs.tag }}"
482482
includeUpdaterJson: true
483483
releaseBody: |
484-
## 🚀 What's New in v${{ needs.prepare-release.outputs.version }}
484+
## What's New in v${{ needs.prepare-release.outputs.version }}
485485
486486
${{ steps.changelog.outputs.total_changes > 0 && format('📊 **Release Summary**: {0} changes', steps.changelog.outputs.total_changes) || '' }}
487487
@@ -585,28 +585,40 @@ jobs:
585585
VERSION="${{ needs.prepare-release.outputs.version }}"
586586
TAG="${{ needs.prepare-release.outputs.tag }}"
587587
588-
# Create the latest.json file
588+
# Create the latest.json file with proper Tauri updater format
589+
# Try to get release notes from the GitHub API
590+
RELEASE_NOTES="Update to version $VERSION. See full release notes at https://github.com/${{ github.repository }}/releases/tag/$TAG"
591+
592+
# Try to fetch release notes from GitHub API
593+
if command -v gh &> /dev/null; then
594+
GITHUB_NOTES=$(gh api repos/${{ github.repository }}/releases/latest --jq '.body' 2>/dev/null || echo "")
595+
if [ -n "$GITHUB_NOTES" ] && [ "$GITHUB_NOTES" != "null" ]; then
596+
# Truncate if too long and clean up markdown
597+
RELEASE_NOTES=$(echo "$GITHUB_NOTES" | head -20 | sed 's/^## /## /g' | sed 's/^### /### /g')
598+
fi
599+
fi
600+
589601
cat > latest.json << EOF
590602
{
591603
"version": "$VERSION",
592-
"notes": "Update to version $VERSION. See full release notes at https://github.com/${{ github.repository }}/releases/tag/$TAG",
604+
"notes": "$RELEASE_NOTES",
593605
"pub_date": "$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")",
594606
"platforms": {
595607
"darwin-aarch64": {
596608
"signature": "",
597-
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_aarch64.app.tar.gz"
609+
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_aarch64.app.tar.gz"
598610
},
599611
"darwin-x86_64": {
600612
"signature": "",
601-
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_x64.app.tar.gz"
613+
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_x64.app.tar.gz"
602614
},
603615
"linux-x86_64": {
604616
"signature": "",
605-
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_amd64.AppImage.tar.gz"
617+
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_amd64.AppImage"
606618
},
607619
"windows-x86_64": {
608620
"signature": "",
609-
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_x64-setup.nsis.zip"
621+
"url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_x64-setup.exe"
610622
}
611623
}
612624
}
@@ -624,6 +636,10 @@ jobs:
624636
echo "🔍 Verifying latest.json is accessible..."
625637
sleep 5 # Give GitHub a moment to process
626638
curl -f "https://github.com/${{ github.repository }}/releases/download/$TAG/latest.json" || echo "⚠️ latest.json not yet accessible"
639+
640+
# Also verify the GitHub API endpoint works
641+
echo "🔍 Verifying GitHub API endpoint..."
642+
curl -f "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq '.tag_name, .assets[] | select(.name == "latest.json") | .browser_download_url' || echo "⚠️ GitHub API endpoint not accessible"
627643
env:
628644
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
629645

CHANGELOG.md

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

3+
## 0.6.1
4+
5+
### Patch Changes
6+
7+
- fix: updater checker
8+
39
## 0.6.0
410

511
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mpesa2csv",
33
"private": true,
4-
"version": "0.6.0",
4+
"version": "0.6.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

scripts/sync-versions.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ console.log("✅ Updated src-tauri/Cargo.toml");
2929
const tauriConfPath = join(rootDir, "src-tauri", "tauri.conf.json");
3030
const tauriConf = JSON.parse(readFileSync(tauriConfPath, "utf8"));
3131
tauriConf.version = version;
32+
33+
// Update updater endpoint to include current version
34+
if (
35+
tauriConf.plugins &&
36+
tauriConf.plugins.updater &&
37+
tauriConf.plugins.updater.endpoints
38+
) {
39+
tauriConf.plugins.updater.endpoints = [
40+
`https://github.com/DavidAmunga/mpesa2csv/releases/download/v${version}/latest.json`,
41+
];
42+
console.log(`✅ Updated updater endpoint to v${version}`);
43+
}
44+
3245
writeFileSync(tauriConfPath, JSON.stringify(tauriConf, null, 2) + "\n");
3346
console.log("✅ Updated src-tauri/tauri.conf.json");
3447

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mpesa2csv"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
description = "Convert M-PESA Statements to CSV/Excel Files"
55
authors = ["David Amunga"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "mpesa2csv",
4-
"version": "0.6.0",
4+
"version": "0.6.1",
55
"identifier": "com.amunga.david.mpesa2csv",
66
"build": {
77
"beforeDevCommand": "pnpm dev",
@@ -81,7 +81,7 @@
8181
"updater": {
8282
"active": true,
8383
"endpoints": [
84-
"https://github.com/DavidAmunga/mpesa2csv/releases/latest/download/latest.json"
84+
"https://github.com/DavidAmunga/mpesa2csv/releases/download/v0.6.1/latest.json"
8585
],
8686
"dialog": true,
8787
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDhEOTM5OERDNTU1QjUwNDUKUldSWTRKaFRuVkVaRzVqWVVGQlJrSkNSa0pEUWpCRFFrSkNSa0pCUWtKQ1FrSkJRa0pCUWc9PQ=="

src/components/update-checker.tsx

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,32 @@ export function UpdateChecker({
3737
const update = await check();
3838
if (update) {
3939
setUpdateAvailable(true);
40+
41+
let releaseNotes = update.body || "No release notes available.";
42+
43+
if (releaseNotes.includes("See full release notes at")) {
44+
try {
45+
const response = await fetch(
46+
`https://api.github.com/repos/DavidAmunga/mpesa2csv/releases/latest`
47+
);
48+
if (response.ok) {
49+
const releaseData = await response.json();
50+
if (releaseData.body && releaseData.body.trim()) {
51+
releaseNotes = releaseData.body;
52+
}
53+
}
54+
} catch (apiError) {
55+
console.warn(
56+
"Failed to fetch release notes from GitHub API:",
57+
apiError
58+
);
59+
}
60+
}
61+
4062
setUpdateInfo({
4163
version: update.version,
4264
date: update.date || "Unknown",
43-
body: update.body || "No release notes available.",
65+
body: releaseNotes,
4466
});
4567
setShowDialog(true);
4668
}
@@ -124,12 +146,54 @@ export function UpdateChecker({
124146

125147
<div className="mb-6">
126148
<h4 className="font-medium mb-2">What's New:</h4>
127-
<div className="text-sm rounded p-3 max-h-32 overflow-y-auto">
128-
{updateInfo.body.split("\n").map((line, index) => (
129-
<p key={index} className="mb-1">
130-
{line}
131-
</p>
132-
))}
149+
<div className="text-sm bg-zinc-900 rounded p-3 max-h-32 overflow-y-auto">
150+
{updateInfo.body.split("\n").map((line, index) => {
151+
let formattedLine = line;
152+
153+
if (line.startsWith("## ")) {
154+
formattedLine = line.replace("## ", "");
155+
return (
156+
<p key={index} className="mb-2 font-semibold text-primary">
157+
{formattedLine}
158+
</p>
159+
);
160+
}
161+
162+
if (line.startsWith("### ")) {
163+
formattedLine = line.replace("### ", "");
164+
return (
165+
<p key={index} className="mb-1 font-medium">
166+
{formattedLine}
167+
</p>
168+
);
169+
}
170+
171+
if (line.startsWith("- ")) {
172+
formattedLine = line.replace("- ", "• ");
173+
return (
174+
<p key={index} className="mb-1 ml-2">
175+
{formattedLine}
176+
</p>
177+
);
178+
}
179+
180+
formattedLine = formattedLine.replace(
181+
/\*\*(.*?)\*\*/g,
182+
"<strong>$1</strong>"
183+
);
184+
185+
if (line.trim() === "") {
186+
return <br key={index} />;
187+
}
188+
189+
return (
190+
<p
191+
key={index}
192+
className="mb-1"
193+
dangerouslySetInnerHTML={{ __html: formattedLine }}
194+
/>
195+
);
196+
})}
133197
</div>
134198
</div>
135199

0 commit comments

Comments
 (0)