mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
93 lines
No EOL
2.5 KiB
YAML
93 lines
No EOL
2.5 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- src/**
|
|
- setup.py
|
|
- Khoj.spec
|
|
- .github/workflows/release.yml
|
|
|
|
jobs:
|
|
publish:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
|
|
- name: Install Khoj Application
|
|
run: |
|
|
pip install --upgrade .
|
|
|
|
- name: Create Mac App
|
|
if: matrix.os == 'macos-latest'
|
|
run: |
|
|
# Set Target Architecture
|
|
sed -E -i "" "s/target_arch='(.*)'/target_arch='x86_64'/g" Khoj.spec
|
|
# Create Mac app
|
|
pyinstaller Khoj.spec
|
|
# Install Mac DMG Creator
|
|
brew install create-dmg
|
|
# Copy app to separate dmg folder
|
|
mkdir -p dist/dmg && cp -r dist/Khoj.app dist/dmg
|
|
# Create disk image with the app
|
|
create-dmg \
|
|
--volname "Khoj" \
|
|
--volicon "src/interface/web/assets/icons/favicon.icns" \
|
|
--window-pos 200 120 \
|
|
--window-size 600 300 \
|
|
--icon-size 100 \
|
|
--icon "Khoj.app" 175 120 \
|
|
--hide-extension "Khoj.app" \
|
|
--app-drop-link 425 120 \
|
|
"dist/Khoj.dmg" \
|
|
"dist/dmg/"
|
|
- uses: actions/upload-artifact@v3
|
|
if : matrix.os == 'macos-latest'
|
|
with:
|
|
name: khoj.dmg
|
|
path: dist/Khoj.dmg
|
|
|
|
- name: Create Windows App
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
run: |
|
|
# Set Target Architecture
|
|
# sed -E -i "s/target_arch='(.*)'/target_arch='x86_64'/g" Khoj.spec
|
|
# Create Windows app
|
|
pyinstaller Khoj.spec
|
|
- uses: actions/upload-artifact@v3
|
|
if : matrix.os == 'windows-latest'
|
|
with:
|
|
name: khoj.exe
|
|
path: dist/Khoj.exe
|
|
|
|
- name: Create Debian App
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
# Set Target Architecture
|
|
sed -E -i "s/target_arch='(.*)'/target_arch='x86_64'/g" Khoj.spec
|
|
# Create Debian app
|
|
pyinstaller Khoj.spec
|
|
- uses: actions/upload-artifact@v3
|
|
if : matrix.os == 'ubuntu-latest'
|
|
with:
|
|
name: khoj.deb
|
|
path: dist/Khoj.deb |