diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..09bb10b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,229 @@ +name: Build & Release + +on: + push: + branches: [main, FFmpeg] + tags: + - 'v*' + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + platform: darwin + arch: x64 + display_name: macOS (Intel) + - os: macos-latest + platform: darwin + arch: arm64 + display_name: macOS (Apple Silicon) + - os: windows-latest + platform: win32 + arch: x64 + display_name: Windows (64-bit) + - os: ubuntu-latest + platform: linux + arch: x64 + display_name: Linux (64-bit) + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + # Install system dependencies for Linux + - name: Install Linux dependencies + if: matrix.platform == 'linux' + run: | + sudo apt-get update + sudo apt-get install -y rpm libarchive-tools + + # Install Python for node-gyp on Windows + - name: Setup Python (Windows) + if: matrix.platform == 'win32' + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: npm ci + + # Package the app + - name: Package (macOS x64) + if: matrix.platform == 'darwin' && matrix.arch == 'x64' + run: npm run make -- --arch=x64 + + - name: Package (macOS arm64) + if: matrix.platform == 'darwin' && matrix.arch == 'arm64' + run: npm run make -- --arch=arm64 + + - name: Package (Windows) + if: matrix.platform == 'win32' + run: npm run make + + - name: Package (Linux) + if: matrix.platform == 'linux' + run: npm run make + + # List what was built (for debugging) + - name: List build outputs + run: | + echo "Build outputs:" + find out/make -type f 2>/dev/null | head -20 || echo "No files found" + shell: bash + continue-on-error: true + + # Upload artifacts with original names first (simpler, more reliable) + - name: Upload macOS DMG (Intel) + if: matrix.platform == 'darwin' && matrix.arch == 'x64' + uses: actions/upload-artifact@v4 + with: + name: Pulp-macOS-Intel + path: out/make/**/*.dmg + if-no-files-found: warn + + - name: Upload macOS DMG (Apple Silicon) + if: matrix.platform == 'darwin' && matrix.arch == 'arm64' + uses: actions/upload-artifact@v4 + with: + name: Pulp-macOS-AppleSilicon + path: out/make/**/*.dmg + if-no-files-found: warn + + - name: Upload macOS ZIP (Intel) + if: matrix.platform == 'darwin' && matrix.arch == 'x64' + uses: actions/upload-artifact@v4 + with: + name: Pulp-macOS-Intel-zip + path: out/make/zip/**/*.zip + if-no-files-found: warn + + - name: Upload macOS ZIP (Apple Silicon) + if: matrix.platform == 'darwin' && matrix.arch == 'arm64' + uses: actions/upload-artifact@v4 + with: + name: Pulp-macOS-AppleSilicon-zip + path: out/make/zip/**/*.zip + if-no-files-found: warn + + - name: Upload Windows installer + if: matrix.platform == 'win32' + uses: actions/upload-artifact@v4 + with: + name: Pulp-Windows + path: | + out/make/**/*.exe + out/make/**/*.msi + if-no-files-found: warn + + - name: Upload Linux packages + if: matrix.platform == 'linux' + uses: actions/upload-artifact@v4 + with: + name: Pulp-Linux + path: | + out/make/**/*.deb + out/make/**/*.rpm + if-no-files-found: warn + + # Create a release when a tag is pushed + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get version + id: version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Organize and rename release files + run: | + mkdir -p release-files + + # Function to find and copy first matching file + copy_first() { + local pattern="$1" + local dest="$2" + local found=$(find artifacts -type f -path "$pattern" | head -1) + if [ -n "$found" ] && [ -f "$found" ]; then + cp "$found" "release-files/$dest" + echo "Copied: $found -> release-files/$dest" + else + echo "Warning: No file found matching $pattern" + fi + } + + # macOS files + copy_first "*/Pulp-macOS-Intel/*.dmg" "Pulp-macOS-Intel.dmg" + copy_first "*/Pulp-macOS-AppleSilicon/*.dmg" "Pulp-macOS-AppleSilicon.dmg" + copy_first "*/Pulp-macOS-Intel-zip/*.zip" "Pulp-macOS-Intel.zip" + copy_first "*/Pulp-macOS-AppleSilicon-zip/*.zip" "Pulp-macOS-AppleSilicon.zip" + + # Windows files + copy_first "*/Pulp-Windows/*.exe" "Pulp-Windows-Installer.exe" + copy_first "*/Pulp-Windows/*.msi" "Pulp-Windows-Installer.msi" + + # Linux files + copy_first "*/Pulp-Linux/*.deb" "Pulp-Linux.deb" + copy_first "*/Pulp-Linux/*.rpm" "Pulp-Linux.rpm" + + echo "Release files:" + ls -lh release-files/ || echo "No files in release-files/" + shell: bash + + - name: Create Release with descriptions + uses: softprops/action-gh-release@v1 + with: + files: release-files/* + draft: false + prerelease: false + generate_release_notes: true + body: | + ## Downloads + + ### 🍎 macOS + - **Pulp-macOS-Intel.dmg** - For Intel Macs (2018 and earlier) + - **Pulp-macOS-AppleSilicon.dmg** - For Apple Silicon Macs (M1, M2, M3, etc.) + - **Pulp-macOS-Intel.zip** - ZIP archive for Intel Macs + - **Pulp-macOS-AppleSilicon.zip** - ZIP archive for Apple Silicon Macs + + ### 🪟 Windows + - **Pulp-Windows-Installer.exe** - Windows installer (recommended) + - **Pulp-Windows-Installer.msi** - Windows MSI installer + + ### 🐧 Linux + - **Pulp-Linux.deb** - For Debian/Ubuntu (`.deb` package) + - **Pulp-Linux.rpm** - For Fedora/RHEL/CentOS (`.rpm` package) + + --- + + **Note for macOS users:** If you see "App can't be opened", right-click the app and select "Open", then click "Open" in the dialog. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..498f116 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2024 Gabbana Juice + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..8181208 --- /dev/null +++ b/README.md @@ -0,0 +1,179 @@ +# Pulp + +
- {saveAsFolder - ? "Images will be saved in a new folder with the specified name" - : "Images will be saved directly to the chosen location with their original names"} -
-- {modalLocationPath} -
- )} -- {modalSuccessMsg} -
- -- Processing images... -
-- Drop the images here... -
- ) : ( -- Drag & drop images here, or click to select -
-- Supports JPEG, PNG, WebP, GIF, and BMP -
-+ Processing {mode === 'image' ? 'images' : 'videos'}... +
++ {isDragActive + ? `Drop ${mode === 'image' ? 'images' : 'videos'} here` + : `Drag & drop ${mode === 'image' ? 'images' : 'videos'} here, or click to select` + } +
++ {mode === 'image' + ? 'Supports JPEG, PNG, WebP, AVIF, TIFF, GIF, BMP' + : 'Supports MP4, WebM, AVI, MOV, MKV, M4V, FLV' + } +
+ > + )} +