-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release: release & add generate release data and openapi generation(b…
…ackend/front) scripts
- Loading branch information
1 parent
f9ea445
commit cfe97f2
Showing
14 changed files
with
111 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
# Exit on error for most commands but allow non-critical errors to be skipped | ||
set -e | ||
set -o pipefail # Capture errors from pipes | ||
|
||
# ============================= | ||
# Create release_temp directory | ||
# ============================= | ||
cd ../ | ||
mkdir -p release_temp/ | ||
|
||
# ============================= | ||
# Copy release assets | ||
# ============================= | ||
echo "Copying release assets..." | ||
|
||
cp docs/assets/logo.png release_temp/logo.png | ||
echo "Copied logo.png" | ||
|
||
cp docs/assets/logo.png release_temp/spotify-electron.desktop | ||
echo "Copied spotify-electron.desktop" | ||
|
||
# ============================= | ||
# Backend OPENAPI generation and Frontend OPENAPI client update | ||
# ============================= | ||
echo "Starting Backend OPENAPI generation and Frontend OpenAPI client update..." | ||
|
||
cd tools/ | ||
./update_openapi.sh | ||
|
||
echo "Virtual environment deactivated" | ||
|
||
# ============================= | ||
# FRONTEND app client | ||
# ============================= | ||
echo "Starting Frontend app client update..." | ||
|
||
# Navigate to the Electron directory | ||
cd ../Electron/ | ||
|
||
# Install dependencies, build, and generate OpenAPI client | ||
npm install | ||
echo "npm install completed" | ||
|
||
npm run build | ||
echo "Frontend build completed" | ||
|
||
# ============================= | ||
# Package the app for Linux and Windows | ||
# ============================= | ||
npm run package:linux:appimage | ||
mv release/build/SpotifyElectron.AppImage ../release_temp/ | ||
echo "Linux AppImage packaged and moved" | ||
|
||
npm run package:win | ||
mv release/build/SpotifyElectron.exe ../release_temp/ | ||
echo "Windows executable packaged and moved" | ||
|
||
# ============================= | ||
# Finish | ||
# ============================= | ||
echo "Release process completed successfully." | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
cd ../ | ||
|
||
|
||
cd Backend/ | ||
|
||
# Activate the virtual environment | ||
source venv/bin/activate | ||
echo "Virtual environment activated" | ||
|
||
# Check if mongomock is installed | ||
if pip show mongomock > /dev/null 2>&1; then | ||
echo "mongomock is installed" | ||
else | ||
echo "mongomock is not installed" | ||
exit 1 | ||
fi | ||
|
||
# Set the environment variable and execute the Python command | ||
echo "Generating OpenAPI schema with timeout..." | ||
timeout 15s env ENV_VALUE="TEST" python -m app.tools.generate_openapi || { | ||
echo "Error: Python generate_openapi script timed out"; | ||
exit 1 | ||
} | ||
|
||
echo "OpenAPI schema generation completed" | ||
|
||
# Deactivate the virtual environment | ||
deactivate | ||
echo "Virtual environment deactivated" | ||
|
||
# Navigate to the Electron directory and run OpenAPI client generation | ||
cd ../Electron/ | ||
|
||
npm install | ||
npm build | ||
# Generate the OpenAPI client | ||
echo "Generating OpenAPI client..." | ||
npm run generate-openapi-client || { echo "Error: OpenAPI client generation failed"; exit 1; } | ||
echo "OpenAPI client generation completed" |