Skip to content

Commit 86f6cfd

Browse files
Merge pull request #6 from stephanebouget/feat-ota
Feat ota
2 parents 666ac1f + 3a6bae6 commit 86f6cfd

17 files changed

Lines changed: 1055 additions & 213 deletions

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
prerelease: false
9999
includeRelease: true
100100
includeDebug: false
101-
includeUpdaterJson: false
102-
updaterJsonPreferNsis: false
101+
includeUpdaterJson: true
102+
updaterJsonPreferNsis: true
103103
args: --target universal-apple-darwin
104104

105105
- name: Self-sign macOS app
@@ -134,5 +134,5 @@ jobs:
134134
prerelease: false
135135
includeRelease: true
136136
includeDebug: false
137-
includeUpdaterJson: false
138-
updaterJsonPreferNsis: false
137+
includeUpdaterJson: true
138+
updaterJsonPreferNsis: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-security-alerts",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "npm run tauri:serve",

release.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash
2+
3+
# Automatic release script
4+
# Usage: ./release.sh 1.2.3
5+
6+
if [ $# -eq 0 ]; then
7+
echo "❌ Usage: $0 <version>"
8+
echo " Example: $0 1.2.3"
9+
exit 1
10+
fi
11+
12+
NEW_VERSION="$1"
13+
14+
# Automatically detect the current version from package.json
15+
CURRENT_VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*"version": "\(.*\)".*/\1/')
16+
17+
echo "🚀 Automatic release: $CURRENT_VERSION$NEW_VERSION"
18+
19+
# Verify that we are in the correct directory
20+
if [ ! -f "package.json" ] || [ ! -f "src-tauri/Cargo.toml" ]; then
21+
echo "❌ Error: Run the script from the project root"
22+
exit 1
23+
fi
24+
25+
echo "📝 Updating versions in all files..."
26+
27+
# 1. package.json
28+
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/g" package.json
29+
30+
# 2. src-tauri/Cargo.toml
31+
sed -i "s/version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/g" src-tauri/Cargo.toml
32+
33+
# 3. src-tauri/tauri.conf.json
34+
if [ -f "src-tauri/tauri.conf.json" ]; then
35+
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/g" src-tauri/tauri.conf.json
36+
fi
37+
38+
# 4. src-tauri/tauri.conf.json.example
39+
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/g" src-tauri/tauri.conf.json.example
40+
41+
# 5. Footer component
42+
sed -i "s/>v$CURRENT_VERSION</>v$NEW_VERSION</g" src/app/shared/components/footer/footer.component.html
43+
44+
# 6. setup.sh
45+
sed -i "s/git tag v$CURRENT_VERSION/git tag v$NEW_VERSION/g" setup.sh
46+
47+
# 7. Update Cargo.lock
48+
echo "🔧 Updating Cargo.lock..."
49+
cd src-tauri
50+
cargo update
51+
cd ..
52+
53+
echo "✅ All versions have been updated"
54+
55+
# Verify changes
56+
echo "📋 Modified files:"
57+
git diff --name-only
58+
59+
echo "🤔 Do you want to proceed with the commit and tag? (y/N)"
60+
read -r response
61+
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
62+
# Commit
63+
echo "💾 Committing changes..."
64+
git add .
65+
git commit -m "chore: bump version to $NEW_VERSION"
66+
67+
# Tag
68+
echo "🏷️ Creating tag v$NEW_VERSION..."
69+
git tag "v$NEW_VERSION"
70+
71+
echo "🎉 Release $NEW_VERSION is ready!"
72+
echo ""
73+
echo "📤 To publish:"
74+
echo " git push origin main --tags"
75+
echo ""
76+
echo "🤖 GitHub Actions will automatically:"
77+
echo " • Build the app"
78+
echo " • Create the release"
79+
echo " • Generate OTA updates"
80+
else
81+
echo "❌ Canceled. You can undo changes with: git checkout ."
82+
fi

setup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# Setup OTA updates
3+
cp src-tauri/tauri.conf.json.example src-tauri/tauri.conf.json
4+
read -p "GitHub username: " USERNAME
5+
sed -i "s/YOUR_USERNAME/$USERNAME/g" src-tauri/tauri.conf.json
6+
echo "OTA setup complete. Run: git tag v1.1.0 && git push --tags"

0 commit comments

Comments
 (0)