diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index af15964..dd98cc4 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -2,50 +2,117 @@ name: Bug Report description: Found a bug? Report it here. labels: [bug] body: -- type: markdown - attributes: - value: | - **Please follow the guidelines below to help us resolve your issue.** - - **Guidelines:** - - Please **search existing issues** to ensure your issue isn't already reported by [checking here](https://github.com/justin025/onthespot/issues?q=is%3Aissue). - - **Report one bug per issue** by creating separate issues for each bug. - - **Provide a descriptive title** that clearly summarizes your issue. - - **Include detailed information** to help us reproduce and fix the problem. - - **If you don't follow the guidelines, the issue will be deleted!** - -- type: textarea - id: description - attributes: - label: Bug Description - description: A detailed and accurate description of the bug is required. - placeholder: When I perform X action, Y happens instead of the expected Z. - validations: - required: true - -- type: textarea - id: environment - attributes: - label: Environment Details - description: Provide details about your setup. - render: markdown - value: | - | **Detail** | **Your Information** | - |--------------------------|--------------------------------------| - | **Operating System** | Windows 10 / MacOS 13 / Ubuntu 22.04 | - | **Application Version** | v0.7.0 | - | **Installation Method** | GitHub Release / Build from Script | - | **Python Version** | 3.11.4 | - | **FFmpeg Version** | e.g., 4.3.1 | - validations: - required: true - -- type: textarea - id: additional_info - attributes: - label: Additional Information - description: Add any other context, screenshots, or logs. - placeholder: Include logs, screenshots, or any other relevant details here. - validations: - required: false + - type: markdown + attributes: + value: | + **Please follow the guidelines below to help us resolve your issue.** + + **Guidelines:** + - Please **search existing issues** to ensure your issue isn't already reported by [checking here](https://github.com/justin025/onthespot/issues?q=is%3Aissue). + - **Report one bug per issue** by creating separate issues for each bug. + - **Provide a descriptive title** that clearly summarizes your issue. + - **Include detailed information** to help us reproduce and fix the problem. + + **If you don't follow the guidelines, the issue will be deleted!** + + - type: textarea + id: ots_description + attributes: + label: Bug Description + description: A detailed and accurate description of the bug is required. + placeholder: When I perform X action, Y happens instead of the expected Z. + validations: + required: true + + # Environment Details Section + + - type: dropdown + id: ots_operating_system + attributes: + label: Operating System + description: Select your operating system. + options: + - Windows + - macOS + - Linux + - Other + validations: + required: true + + # Operating System Version Input + + - type: input + id: ots_os_version + attributes: + label: Operating System Version + description: Specify your operating system version. + placeholder: e.g., Windows 11, macOS Ventura (13), Ubuntu 22.04 LTS + validations: + required: true + conditions: + - field: ots_operating_system + any: + - Windows + - macOS + - Linux + + # Other Operating System Specification + + - type: input + id: ots_operating_system_other + attributes: + label: Specify Operating System + description: If you selected 'Other', please specify your OS and version. + placeholder: e.g., FreeBSD 13.0 + validations: + required: true + conditions: + - field: ots_operating_system + equals: Other + + - type: input + id: ots_application_version + attributes: + label: Application Version + description: Enter the version of the OnTheSpot application you are using. + placeholder: e.g., v0.7.0 + validations: + required: true + + - type: dropdown + id: ots_installation_method + attributes: + label: Installation Method + description: How did you install the OnTheSpot application? + options: + - GitHub Release + - Build from Script + validations: + required: true + + - type: input + id: ots_python_version + attributes: + label: Python Version + description: Enter your Python version, check with `python --version` in Terminal. + placeholder: e.g., 3.11.4 + validations: + required: true + + - type: input + id: ots_ffmpeg_version + attributes: + label: FFmpeg Version + description: Enter your FFmpeg version, check with `ffmpeg -version` in Terminal. + placeholder: e.g., 2024-09-05 + validations: + required: true + + - type: textarea + id: ots_additional_info + attributes: + label: Additional Information + description: Add any other context, screenshots, or logs. + placeholder: Include logs, screenshots, or any other relevant details here. + validations: + required: false diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..3491335 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,50 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +version-template: '$MAJOR.$MINOR.$PATCH' + +categories: + - title: '## Features' + labels: + - 'feat' + - 'feature' + - title: '## Bug Fixes' + labels: + - 'fix' + - 'bug' + - title: '## Documentation' + labels: + - 'docs' + - 'documentation' + - title: '## Chores' + labels: + - 'chore' + - 'maintenance' + +change-template: '- $TITLE ([#$NUMBER]($URL)) ([`$SHORT_SHA`]($COMMIT_URL)) by @$AUTHOR' + +autolabeler: + - label: 'feat' + title: '^feat' + - label: 'fix' + title: '^fix' + - label: 'docs' + title: '^docs' + - label: 'chore' + title: '^chore' + +exclude-labels: + - 'duplicate' + - 'invalid' + - 'question' + - 'wontfix' + +template: | + # :sparkles: New Release: v$NEXT_PATCH_VERSION + + Thanks to everyone for their contributions! + + $CHANGES + + **Full Changelog**: [$PREVIOUS_TAG...$NEW_TAG]($COMPARE_URL) + + **Contributors**: $CONTRIBUTORS diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..0ba830d --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,29 @@ +name: Changelog + +on: + push: + branches: + - main + +jobs: + changelog: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + uses: actions/create-release@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} diff --git a/.github/workflows/release-builder.yml b/.github/workflows/release-builder.yml new file mode 100644 index 0000000..ee5996c --- /dev/null +++ b/.github/workflows/release-builder.yml @@ -0,0 +1,189 @@ +name: Release Builder + +on: + push: + branches: + - main + pull_request: + branches: + - main + release: + types: [published] + +jobs: + # Windows Build + windows-build: + runs-on: windows-latest + outputs: + artifact_path: artifacts/windows/ + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Run Windows Build Script + run: scripts/workflow/build_windows.bat + shell: cmd + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: windows-build + path: artifacts/windows/ + + # Linux Build + linux-build: + runs-on: ubuntu-latest + outputs: + artifact_path: artifacts/linux/ + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y patchelf fuse libfuse2 + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Make Build Script Executable + run: chmod +x scripts/workflow/build_linux.sh + + - name: Run Linux Build Script + run: scripts/workflow/build_linux.sh + shell: bash + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: linux-build + path: artifacts/linux/ + + # macOS Build + macos-build: + runs-on: macos-latest + outputs: + artifact_path: artifacts/macos/ + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + brew install pyinstaller + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Make Build Script Executable + run: chmod +x scripts/workflow/build_mac.sh + + - name: Run macOS Build Script + run: scripts/workflow/build_mac.sh + shell: bash + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: macos-build + path: artifacts/macos/ + + # Collect Artifacts + collect-artifacts: + name: Collect Artifacts + needs: [windows-build, linux-build, macos-build] + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Download Windows Artifacts + uses: actions/download-artifact@v3 + with: + name: windows-build + path: artifacts/windows/ + + - name: Download Linux Artifacts + uses: actions/download-artifact@v3 + with: + name: linux-build + path: artifacts/linux/ + + - name: Download macOS Artifacts + uses: actions/download-artifact@v3 + with: + name: macos-build + path: artifacts/macos/ + + - name: Upload Combined Artifacts + uses: actions/upload-artifact@v3 + with: + name: OnTheSpot-Builds + path: artifacts/ + + - name: Create Release + if: github.event_name == 'release' + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.release.tag_name }} + release_name: ${{ github.event.release.name }} + draft: false + prerelease: false + + - name: Upload Windows Executable to Release + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/windows/onthespot_windows.exe + asset_name: onthespot_windows.exe + asset_content_type: application/octet-stream + + - name: Upload Linux Tar.gz to Release + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/linux/onthespot_linux.tar.gz + asset_name: onthespot_linux.tar.gz + asset_content_type: application/gzip + + - name: Upload Linux AppImage to Release + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/linux/OnTheSpot.AppImage + asset_name: OnTheSpot.AppImage + asset_content_type: application/octet-stream + + - name: Upload macOS DMG to Release + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/macos/OnTheSpot.dmg + asset_name: OnTheSpot.dmg + asset_content_type: application/x-apple-diskimage diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..503336b --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,50 @@ +name: Release Drafter + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install Conventional Changelog CLI + run: | + npm install -g conventional-changelog-cli + + - name: Release Drafter + run: | + conventional-changelog -p angular -i CHANGELOG.md -s -r 0 --config ./changelog-config.js + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Commit and Push Changelog + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add CHANGELOG.md + git commit -m "docs(changelog): update changelog [skip ci]" + git push origin HEAD:${{ github.ref_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ github.ref_name }} + name: ${{ github.ref_name }} + commit: ${{ github.sha }} + body: | + $(cat CHANGELOG.md) + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/contributing.md b/CONTRIBUTING.md similarity index 90% rename from docs/contributing.md rename to CONTRIBUTING.md index 3bca845..c75e096 100644 --- a/docs/contributing.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ - - - Logo of OnTheSpot + + + Logo of OnTheSpot
diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..b872269 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,33 @@ + + + + Logo of OnTheSpot + + +
+ +# Thanks and Acknowledgements + +We would like to thank all the contributors who have helped improve this repository. We truly appreciate your time, dedication, and commitment to helping us improve and grow. + +## Contributors + +- **Justin025** [@justin025](https://github.com/justin025/) +- **V1p3rOne** [@V1p3rOne](https://github.com/V1p3rOne) +- **Medmondson** [@medmondson-spot](https://github.com/medmondson-spot) + +## Tools Used + +- [Python](https://www.python.org/) +- [Qt for Python (PyQt/PySide)](https://riverbankcomputing.com/software/pyqt/intro) +- [PyInstaller](https://www.pyinstaller.org/) +- [FFmpeg](https://ffmpeg.org/) +- [Spotify Developers API](https://developer.spotify.com/) +- [GitHub Actions](https://github.com/features/actions) +- [Linux AppImage](https://appimage.org/) +- [MacOS DMG Creation Tools](https://apple.com) +- [Windows Build Tools](https://learn.microsoft.com/en-us/windows/win32/debug/building-on-the-command-line) + +## Our Community + +Lastly, a big thanks to all our users and community members who have provided feedback, reported bugs, or shared their suggestions for improvement. Thanks for your help with this project! diff --git a/docs/disclaimer.md b/DISCLAIMER.md similarity index 93% rename from docs/disclaimer.md rename to DISCLAIMER.md index 04763ae..d05ba0b 100644 --- a/docs/disclaimer.md +++ b/DISCLAIMER.md @@ -1,7 +1,7 @@ - - - Logo of OnTheSpot + + + Logo of OnTheSpot
diff --git a/README.md b/README.md index a5ca129..e87e52c 100755 --- a/README.md +++ b/README.md @@ -8,12 +8,9 @@ -
- [![Issues Badge][issues-shield]][issues-url] [![Stars Badge][stars-shield]][stars-url] [![Downloads Badge][downloads-shield]][downloads-url] -[![Commits Badge][commits-shield]][commits-url] [![License Badge][license-shield]][license-url]

@@ -38,9 +35,9 @@ OnTheSpot is a open-source user-friendly music downloader built with Qt and Pyth ### Features -- [**Cross-Platform**](https://www.techopedia.com/definition/17056/cross-platform)
Available for Windows, macOS, and Linux (Including AppImage, PKGBUILD, and eBuild). -- [**High-Quality Downloads**](https://www.whathifi.com/advice/high-resolution-audio-everything-you-need-to-know)
Download music up to 320kbps directly from the source. -- [**Multi-Language Support**](https://phrase.com/blog/posts/multilingual-customer-support/)
Download track and album names translated to your application's language. +- [**Cross Platform**](https://www.techopedia.com/definition/17056/cross-platform)
Available for Windows, MacOS, and Linux (Including AppImage, PKGBUILD, and eBuild). +- [**High Quality Downloads**](https://www.whathifi.com/advice/high-resolution-audio-everything-you-need-to-know)
Download music up to 320kbps directly from the source. +- [**Multi Language Support**](https://phrase.com/blog/posts/multilingual-customer-support/)
Download track and album names translated to your application's language. - [**Comprehensive Content Coverage**](https://thisisglance.com/blog/why-spotify-is-the-outright-best-music-streaming-app)
Supports songs, podcasts, playlists, albums, singles, compilations, and audiobooks. - [**Rich Metadata Embedding**](https://sonosuite.com/en/blog/what-is-music-metadata-and-why-is-important-to-digital-music/)
Automatically embed detailed metadata like artist, album, year, and lyrics. - [**Custom Download Paths**](https://www.microsoft.com/en-us/microsoft-365/business-insights-ideas/resources/11-ideas-for-how-to-organize-digital-files)
Set personalized paths for playlists and episodes for easy organization. @@ -91,17 +88,14 @@ For full details, please read our [**Disclaimer**](docs/disclaimer.md). If you have any questions, concerns, or need assistance feel free to [contact us](mailto:justin026@protonmail.com). -[issues-shield]: https://img.shields.io/github/issues/justin025/onthespot?style=flat&label=Issues&labelColor=003366&color=1DB954 +[issues-shield]: https://img.shields.io/github/issues/justin025/onthespot?style=flat&label=Issues&labelColor=001224&color=1DB954 [issues-url]: https://github.com/justin025/onthespot/issues -[stars-shield]: https://img.shields.io/github/stars/justin025/onthespot?style=flat&label=Stars&labelColor=003366&color=1DB954 +[stars-shield]: https://img.shields.io/github/stars/justin025/onthespot?style=flat&label=Stars&labelColor=001224&color=1DB954 [stars-url]: https://github.com/justin025/onthespot/stargazers -[downloads-shield]: https://img.shields.io/github/downloads/justin025/onthespot/total.svg?style=flat&label=Downloads&labelColor=003366&color=1DB954 +[downloads-shield]: https://img.shields.io/github/downloads/justin025/onthespot/total.svg?style=flat&label=Downloads&labelColor=001224&color=1DB954 [downloads-url]: https://github.com/justin025/onthespot/releases/ - -[commits-shield]: https://img.shields.io/github/commit-activity/m/justin025/onthespot?style=flat&label=Commits&labelColor=003366&color=1DB954 -[commits-url]: https://github.com/justin025/onthespot/commits/main -[license-shield]: https://img.shields.io/github/license/justin025/onthespot?style=flat&label=License&labelColor=003366&color=1DB954 +[license-shield]: https://img.shields.io/github/license/justin025/onthespot?style=flat&label=License&labelColor=001224&color=1DB954 [license-url]: https://github.com/justin025/onthespot/blob/main/LICENSE diff --git a/assets/01_Logo/Cover_Black.png b/assets/01_Logo/Cover_Black.png index 8d67692..d3117c9 100644 Binary files a/assets/01_Logo/Cover_Black.png and b/assets/01_Logo/Cover_Black.png differ diff --git a/assets/01_Logo/Cover_White.png b/assets/01_Logo/Cover_White.png index 357dd25..fc0c276 100644 Binary files a/assets/01_Logo/Cover_White.png and b/assets/01_Logo/Cover_White.png differ diff --git a/docs/credits.md b/docs/credits.md deleted file mode 100644 index 5cbc1cb..0000000 --- a/docs/credits.md +++ /dev/null @@ -1,15 +0,0 @@ - - - - Logo of OnTheSpot - - -
- -# Thanks and Acknowledgements - -We would like to thank all the contributors who have helped improve this repository. We truly appreciate your time, dedication, and commitment to helping us improve and grow. - -* Justin025 [@justin025](https://github.com/justin025/) -* V1p3rOne [@V1p3rOne](https://github.com/V1p3rOne) -* Medmondson [@medmondson-spot](https://github.com/medmondson-spot) diff --git a/docs/installation.md b/docs/installation.md index e302cf5..297ae7a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -55,10 +55,10 @@ If you prefer to build OnTheSpot yourself, follow these steps. 2. **Run the Build Script for Your Operating System** - - **Windows**: Open the `scripts` Folder. Double-click [`build_windows.bat`](scripts/build_windows.bat) or run it in Command Prompt. - - **MacOS**: Run [`build_mac.sh`](scripts/build_mac.sh) in Terminal with `./scripts/build_mac.sh`. - - **Linux**: Run [`build_linux.sh`](scripts/build_linux.sh) in Terminal with `./scripts/build_linux.sh`. - - **Linux AppImage**: Run [`build_appimage.sh`](scripts/build_appimage.sh) in Terminal with `./scripts/build_appimage.sh`. + - **Windows**: Open the `scripts` Folder. Double-click [`build_windows.bat`](scripts/workflow/build_windows.bat) or run it in Command Prompt. + - **MacOS**: Run [`build_mac.sh`](scripts/workflow/build_mac.sh) in Terminal with `./scripts/workflow/build_mac.sh`. + - **Linux**: Run [`build_linux.sh`](scripts/workflow/build_linux.sh) in Terminal with `./scripts/workflow/build_linux.sh`. + - **Linux AppImage**: Run [`build_appimage.sh`](scripts/workflow/build_appimage.sh) in Terminal with `./scripts/workflow/build_appimage.sh`. > [!WARNING] > Make sure to run the correct script for your platform to avoid any build failures. diff --git a/scripts/build_appimage.sh b/scripts/user/build_appimage.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/build_appimage.sh rename to scripts/user/build_appimage.sh diff --git a/scripts/build_linux.sh b/scripts/user/build_linux.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/build_linux.sh rename to scripts/user/build_linux.sh diff --git a/scripts/build_mac.sh b/scripts/user/build_mac.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/build_mac.sh rename to scripts/user/build_mac.sh diff --git a/scripts/build_windows.bat b/scripts/user/build_windows.bat similarity index 100% rename from scripts/build_windows.bat rename to scripts/user/build_windows.bat diff --git a/scripts/workflow/build_linux.sh b/scripts/workflow/build_linux.sh new file mode 100644 index 0000000..8fb14e2 --- /dev/null +++ b/scripts/workflow/build_linux.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +echo "========= OnTheSpot Linux Build Script =========" + +# Get the directory of the script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Change to the project root directory (parent of scripts directory) +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +cd "$PROJECT_ROOT" + +echo "Current directory: $(pwd)" + +# Clean up previous builds +echo " => Cleaning up!" +rm -f ./dist/onthespot_linux ./dist/onthespot_linux_ffm +rm -f ./dist/onthespot_linux.tar.gz +rm -f ./dist/OnTheSpot.AppImage +rm -rf ./AppDir + +# Check for FFmpeg and set build options +if [ -f "ffbin_nix/ffmpeg" ]; then + echo " => Found 'ffbin_nix' directory and ffmpeg binary. Including FFmpeg in the build." + FFBIN="--add-binary=ffbin_nix/*:onthespot/bin/ffmpeg" + NAME="onthespot_linux_ffm" +else + echo " => FFmpeg binary not found. Building without it." + FFBIN="" + NAME="onthespot_linux" +fi + +# Run PyInstaller +echo " => Running PyInstaller..." +pyinstaller --onefile \ + --hidden-import=zeroconf._utils.ipaddress \ + --hidden-import=zeroconf._handlers.answers \ + --add-data="src/onthespot/gui/qtui/*.ui:onthespot/gui/qtui" \ + --add-data="src/onthespot/resources/icons/*.png:onthespot/resources/icons" \ + --add-data="src/onthespot/resources/themes/*.qss:onthespot/resources/themes" \ + --add-data="src/onthespot/resources/translations/*.qm:onthespot/resources/translations" \ + $FFBIN \ + --paths="src/onthespot" \ + --name="$NAME" \ + --icon="src/onthespot/resources/icons/onthespot.png" \ + src/portable.py + +# Check if the build was successful +if [ -f "./dist/$NAME" ]; then + # Set executable permissions + echo " => Setting executable permissions..." + chmod +x "./dist/$NAME" +else + echo " => Build failed or output file not found." + exit 1 +fi + +# Create .tar.gz archive +echo " => Creating tar.gz archive..." +cd dist +tar -czvf "$NAME.tar.gz" "$NAME" +cd .. + +# Build AppImage +echo " => Building AppImage..." + +# Download linuxdeploy +wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +chmod +x linuxdeploy-x86_64.AppImage + +# Create AppDir structure +mkdir -p AppDir/usr/bin +cp "dist/$NAME" AppDir/usr/bin/onthespot + +# Copy desktop file and icon +mkdir -p AppDir/usr/share/applications +mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps + +cp src/onthespot/resources/icons/onthespot.png AppDir/usr/share/icons/hicolor/256x256/apps/onthespot.png + +# Create desktop file +cat > AppDir/usr/share/applications/onthespot.desktop < Moving artifacts to artifacts folder..." +mkdir -p artifacts/linux +mv dist/"$NAME.tar.gz" artifacts/linux/ +mv dist/OnTheSpot.AppImage artifacts/linux/ + +# Clean up +rm linuxdeploy-x86_64.AppImage +rm -rf AppDir + +# Clean up unnecessary files +echo " => Cleaning up temporary files..." +rm -rf __pycache__ build *.spec + +echo " => Done!" diff --git a/scripts/workflow/build_mac.sh b/scripts/workflow/build_mac.sh new file mode 100644 index 0000000..7ae494d --- /dev/null +++ b/scripts/workflow/build_mac.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +echo "========= OnTheSpot MacOS Build Script ==========" + +# Get the directory of the script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Change to the project root directory (parent of scripts directory) +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +cd "$PROJECT_ROOT" + +echo "Current directory: $(pwd)" + +# Clean up previous builds +echo " => Cleaning up!" +rm -rf ./dist/OnTheSpot.app +rm -f ./dist/OnTheSpot.dmg + +# Check for FFmpeg binary and set build options +if [ -f "ffbin_mac/ffmpeg" ]; then + echo " => Found 'ffbin_mac' directory and ffmpeg binary. Including FFmpeg in the build." + FFBIN='--add-binary=ffbin_mac/*:onthespot/bin/ffmpeg' +else + echo " => FFmpeg binary not found. Building without it." + FFBIN="" +fi + +# Run PyInstaller to create the app +echo " => Running PyInstaller..." +pyinstaller --windowed \ + --hidden-import=zeroconf._utils.ipaddress \ + --hidden-import=zeroconf._handlers.answers \ + --add-data="src/onthespot/gui/qtui/*.ui:onthespot/gui/qtui" \ + --add-data="src/onthespot/resources/icons/*.png:onthespot/resources/icons" \ + --add-data="src/onthespot/resources/themes/*.qss:onthespot/resources/themes" \ + --add-data="src/onthespot/resources/translations/*.qm:onthespot/resources/translations" \ + $FFBIN \ + --paths="src/onthespot" \ + --name="OnTheSpot" \ + --icon="src/onthespot/resources/icons/onthespot.icns" \ + src/portable.py + +# Check if the build was successful +if [ -d "./dist/OnTheSpot.app" ]; then + # Set executable permissions + echo " => Setting executable permissions..." + chmod +x "./dist/OnTheSpot.app" +else + echo " => Build failed or output app not found." + exit 1 +fi + +# Create .dmg file +echo " => Creating DMG file..." +mkdir -p dist/dmg_contents +cp -R dist/OnTheSpot.app dist/dmg_contents/ +hdiutil create -volname "OnTheSpot" -srcfolder dist/dmg_contents -ov -format UDZO dist/OnTheSpot.dmg +rm -rf dist/dmg_contents + +# Move the DMG to artifacts folder +echo " => Moving DMG to artifacts folder..." +mkdir -p artifacts/macos +mv dist/OnTheSpot.dmg artifacts/macos/ + +# Clean up unnecessary files +echo " => Cleaning up temporary files..." +rm -rf __pycache__ build *.spec + +echo " => Done!" diff --git a/scripts/workflow/build_windows.bat b/scripts/workflow/build_windows.bat new file mode 100644 index 0000000..3da6a77 --- /dev/null +++ b/scripts/workflow/build_windows.bat @@ -0,0 +1,76 @@ +@echo off + +echo ========= OnTheSpot Windows Build Script ========= + +REM Navigate to the root directory if in scripts +set FOLDER_NAME=%cd% +for %%F in ("%cd%") do set FOLDER_NAME=%%~nxF +if /i "%FOLDER_NAME%"=="scripts" ( + echo You are in the scripts folder. Changing to the parent directory... + cd .. +) + +REM Clean up previous builds +echo => Cleaning up previous builds... +del /F /Q dist\* 2>nul + +REM Bundle ffmpeg +echo => Downloading FFmpeg binary... +mkdir build +curl -L https://github.com/GyanD/codexffmpeg/releases/download/7.1/ffmpeg-7.1-essentials_build.zip -o build\ffmpeg.zip || ( + echo Failed to download FFmpeg. Exiting... + exit /b 1 +) + +powershell -Command "Expand-Archive -Path build\ffmpeg.zip -DestinationPath build\ffmpeg" || ( + echo Failed to extract FFmpeg. Exiting... + exit /b 1 +) + +mkdir ffbin_win + +REM Find the extracted FFmpeg directory +set FFMPEG_DIR= +for /d %%D in ("build\ffmpeg\*") do set FFMPEG_DIR=%%D +if defined FFMPEG_DIR ( + copy "%FFMPEG_DIR%\bin\ffmpeg.exe" ffbin_win\ || ( + echo Failed to copy FFmpeg binary. Exiting... + exit /b 1 + ) +) else ( + echo Failed to find extracted FFmpeg directory. Exiting... + exit /b 1 +) + +REM Build with PyInstaller +echo => Building executable with PyInstaller... +pyinstaller --onefile --noconsole --noconfirm ^ + --hidden-import=zeroconf._utils.ipaddress ^ + --hidden-import=zeroconf._handlers.answers ^ + --add-data="src/onthespot/resources/translations/*.qm;onthespot/resources/translations" ^ + --add-data="src/onthespot/resources/themes/*.qss;onthespot/resources/themes" ^ + --add-data="src/onthespot/gui/qtui/*.ui;onthespot/gui/qtui" ^ + --add-data="src/onthespot/resources/icons/*.png;onthespot/resources/icons" ^ + --add-binary="ffbin_win/ffmpeg.exe;onthespot/bin/ffmpeg" ^ + --paths=src/onthespot ^ + --name=onthespot_windows ^ + --icon=src/onthespot/resources/icons/onthespot.png ^ + src\portable.py || ( + echo PyInstaller build failed. Exiting... + exit /b 1 +) + +REM Move the executable to artifacts folder +echo => Moving executable to artifacts folder... +mkdir artifacts +mkdir artifacts\windows +move dist\onthespot_windows.exe artifacts\windows\ + +REM Clean up unnecessary files +echo => Cleaning up temporary files... +del /F /Q *.spec 2>nul +rd /s /q build 2>nul +rd /s /q __pycache__ 2>nul +rd /s /q ffbin_win 2>nul + +echo => Done!