diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..481b513 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,72 @@ +name: Build Wildbook Installers +on: + push: + branches: + - devops-build + pull_request: + +permissions: + issues: write + pull-requests: write + contents: write + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 360 # Set the timeout to 6 hours + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'npm' + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Ensure setuptools is installed + run: | + python3 -m ensurepip + python3 -m pip install setuptools + + - name: Install dependencies in Windows + shell: powershell + if: ${{ matrix.os == 'windows-latest' }} + run: | + $env:NODE_GYP_FORCE_PYTHON = (Get-Command python | Select-Object -ExpandProperty Path) + npm install --no-audit + + - name: Install dependencies in Mac + shell: bash + if: ${{ matrix.os == 'macos-latest' }} + run: | + NODE_GYP_FORCE_PYTHON=$(which python3) npm install --save-dev appdmg --no-audit + npm install --no-audit + + + - name: Build the application + run: npm run make + + - name: List win output directory + shell: cmd + if: ${{ matrix.os == 'windows-latest' }} + run: dir out\make\squirrel.windows\x64 + + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-installer + path: | + out\make\squirrel.windows\x64\*.exe + out/make/*.dmg + diff --git a/README.md b/README.md new file mode 100644 index 0000000..f615ce2 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +## Manual Build Instructions + + +# Project Build and Packaging Instructions + +This guide explains how to manually build and package the application for different platforms without using GitHub Actions. + +## Prerequisites +- Node.js (v18 or higher) +- Python (v3.10) +- A working internet connection to install dependencies + +--- + +## Steps to Build and Package the Application + +### 1. Install Dependencies +Run the following command to install all required dependencies: + +```bash +npm install --no-audit +``` + +If your project relies on native dependencies (e.g., node-gyp), ensure Python is properly configured: + +On macOS/Linux: + +``` bash + +export NODE_GYP_FORCE_PYTHON=$(which python3) +``` + +On Windows, manually set the Python path by running: + +```powershell + +$env:NODE_GYP_FORCE_PYTHON = (Get-Command python | Select-Object -ExpandProperty Path) +``` + +2. Build the Application +Run the following command to generate platform-specific installers: + +```bash + +npm run make +``` + +This will create the output files in the out/make directory. + +3. Verify the Output +Once the build process is complete, check the out/make directory for the generated files: + +On macOS/Linux: + +```bash +ls out/make +``` + +On Windows: + +``` +powershell + +dir out\make\squirrel.windows\x64 +``` + +4. Upload Installers +Locate the generated installer files: + +.dmg for macOS +.exe for Windows +Manually upload these files to the desired location (e.g., file server, cloud storage). + +## Notes: +If you encounter issues during dependency installation, ensure Python is correctly installed and accessible in your system’s PATH. +Suppress warnings about vulnerabilities using the --no-audit flag when running npm install. +For more debugging, check the build logs in your terminal or use the verbose mode: + +```bash + +npm run make -- --verbose +```