2022-08-14 00:53:37 +02:00
|
|
|
name: release
|
|
|
|
|
|
|
|
on:
|
2022-08-14 01:38:20 +02:00
|
|
|
push:
|
2022-08-14 01:40:43 +02:00
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
pull_request:
|
2022-08-14 01:38:20 +02:00
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
paths:
|
|
|
|
- src/**
|
|
|
|
- setup.py
|
|
|
|
- Khoj.spec
|
|
|
|
- .github/workflows/release.yml
|
2022-08-14 00:53:37 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
2022-08-14 02:38:29 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
2022-08-14 02:43:07 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-08-14 00:53:37 +02:00
|
|
|
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
|
|
|
|
|
2022-08-14 02:46:41 +02:00
|
|
|
- name: Install Khoj Application
|
2022-08-14 00:53:37 +02:00
|
|
|
run: |
|
|
|
|
pip install --upgrade .
|
|
|
|
|
2022-08-14 02:46:41 +02:00
|
|
|
- name: Create Mac App
|
2022-08-14 02:38:29 +02:00
|
|
|
if: matrix.os == 'macos-latest'
|
2022-08-14 00:53:37 +02:00
|
|
|
run: |
|
|
|
|
# Set Target Architecture
|
2022-08-14 01:54:14 +02:00
|
|
|
sed -E -i "" "s/target_arch='(.*)'/target_arch='x86_64'/g" Khoj.spec
|
2022-08-14 00:53:37 +02:00
|
|
|
# Create Mac app
|
|
|
|
pyinstaller Khoj.spec
|
2022-08-14 02:46:41 +02:00
|
|
|
# Install Mac DMG Creator
|
|
|
|
brew install create-dmg
|
2022-08-14 00:53:37 +02:00
|
|
|
# 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/"
|
2022-08-14 02:26:40 +02:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-08-14 02:38:29 +02:00
|
|
|
if : matrix.os == 'macos-latest'
|
2022-08-14 02:26:40 +02:00
|
|
|
with:
|
|
|
|
name: khoj.dmg
|
2022-08-14 02:38:29 +02:00
|
|
|
path: dist/Khoj.dmg
|
|
|
|
|
2022-08-14 02:46:41 +02:00
|
|
|
- name: Create Windows App
|
2022-08-14 02:38:29 +02:00
|
|
|
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
|
|
|
|
|
2022-08-14 02:46:41 +02:00
|
|
|
- name: Create Debian App
|
2022-08-14 02:38:29 +02:00
|
|
|
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
|