-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrelease.sh
More file actions
112 lines (89 loc) Β· 3.32 KB
/
release.sh
File metadata and controls
112 lines (89 loc) Β· 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# TRUSTBOT Release Script - No Release Notes Version
# This script automates the release process without prompting for release notes
echo "π TRUSTBOT Release Process Starting..."
echo "==========================================="
# Step 1: Check if GH_TOKEN is set
if [ -z "$GH_TOKEN" ]; then
echo "β ERROR: GitHub token not found!"
echo ""
echo "Please set your GitHub token first:"
echo "export GH_TOKEN='your_github_token_here'"
echo ""
echo "Get your token from: https://github.com/settings/personal-access-tokens/fine-grained"
exit 1
fi
echo "β
GitHub token found"
# Step 2: Clean previous builds
echo "π§Ή Cleaning previous builds..."
rm -rf dist/
echo "β
Cleaned dist folder"
# Step 3: Install/update dependencies
echo "π¦ Checking dependencies..."
npm install
echo "β
Dependencies ready"
# Step 4: Build for ALL platforms
echo "ποΈ Building for ALL platforms..."
echo "This will create:"
echo " β’ macOS: DMG and ZIP files"
echo " β’ Windows: EXE installer and portable"
echo " β’ Linux: AppImage and DEB packages"
echo ""
# Directly use electron-builder to ensure cross-platform builds
echo "ποΈ Building for all platforms (macOS, Windows, Linux)..."
# Build for all platforms with specific configuration
echo "π₯οΈ Building macOS packages..."
npx electron-builder --mac --arm64 --x64 --publish=always
echo "πͺ Building Windows packages..."
npx electron-builder --win --publish=always
echo "π§ Building Linux packages..."
npx electron-builder --linux --publish=always
if [ $? -ne 0 ]; then
echo "β Build failed! Check the errors above."
exit 1
fi
echo "β
All builds completed successfully!"
# Step 5: Show what was built and generate checksums
echo ""
echo "π Built files:"
ls -la dist/ | grep -E '\.(dmg|exe|AppImage|deb|zip)$'
# Generate checksums for verification
echo ""
echo "π Generating checksums for verification..."
cd dist
shasum -a 256 *.{dmg,exe,AppImage,zip,deb} > SHA256SUMS.txt 2>/dev/null
cd ..
# Step 6: Create minimal release notes file with just the version
echo ""
echo "π Creating minimal release notes..."
# Create a temporary file for release notes
RELEASE_NOTES_FILE="release-notes.md"
# Just add the version header without prompting for notes
VERSION=$(node -e "console.log(require('./package.json').version)")
echo "# Version ${VERSION}" > "${RELEASE_NOTES_FILE}"
echo "" >> "${RELEASE_NOTES_FILE}"
echo "Maintenance release" >> "${RELEASE_NOTES_FILE}"
echo ""
echo "π€ Publishing to GitHub Releases with minimal notes..."
# Step 7: Create GitHub release with all files
npx electron-builder --publish=always --config.publish.releaseType=release
if [ $? -eq 0 ]; then
echo ""
echo "π SUCCESS! Your app has been built and published!"
echo ""
echo "π¦ What was created:"
echo " β’ Cross-platform installers in dist/ folder"
echo " β’ GitHub release with all files uploaded"
echo " β’ SHA256 checksums for verification"
echo ""
echo "π Check your GitHub releases page to see the published version"
echo "π Users can now download and install your app!"
else
echo "β Publishing failed! Check the errors above."
echo "π‘ You can still find the built files in the 'dist' folder"
exit 1
fi
# Clean up
rm -f "${RELEASE_NOTES_FILE}"
echo ""
echo "β¨ Release process complete!"