Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create devops-build for the app #13

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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

82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```