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

Add DEB bundle #483

Merged
merged 14 commits into from
Jun 6, 2023
Merged
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
57 changes: 34 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ jobs:
- name: Install dependencies
run: poetry install

- name: Test
- name: Install apt dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
sudo apt update
sudo apt install -y libpulse-mainloop-glib0 libegl1-mesa-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libportaudio2
fi
sudo apt-get update
sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-shape0 libxcb-cursor0 libportaudio2 gettext
if: "startsWith(matrix.os, 'ubuntu-')"

- name: Test
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
curl -OL "https://github.com/ggerganov/whisper.cpp/releases/download/v1.3.0/whisper-bin-x64.zip"
unzip whisper-bin-x64.zip
Expand Down Expand Up @@ -124,6 +123,22 @@ jobs:
- name: Install dependencies
run: poetry install

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
if: "startsWith(matrix.os, 'ubuntu-')"

- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-shape0 libxcb-cursor0 libportaudio2 gettext
if: "startsWith(matrix.os, 'ubuntu-')"

- name: Install FPM
run: gem install fpm
if: "startsWith(matrix.os, 'ubuntu-')"

- name: Bundle
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
Expand Down Expand Up @@ -160,13 +175,9 @@ jobs:
poetry run make bundle_windows

elif [ "$RUNNER_OS" == "Linux" ]; then

sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
sudo apt update
sudo apt install -y libpulse-mainloop-glib0 libegl1-mesa-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libportaudio2 gettext

poetry run make bundle_linux

fi
env:
BUZZ_CODESIGN_IDENTITY: ${{ secrets.BUZZ_CODESIGN_IDENTITY }}
Expand All @@ -185,7 +196,7 @@ jobs:
path: |
dist/Buzz*-windows.exe
dist/Buzz*-mac.dmg
dist/Buzz*-unix.tar.gz
dist/buzz-*.deb

benchmark:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -238,15 +249,14 @@ jobs:
- name: Install dependencies
run: poetry install

- name: Test
- name: Install apt dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
sudo apt update
sudo apt install -y libpulse-mainloop-glib0 libegl1-mesa-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libportaudio2
fi
sudo apt-get update
sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-shape0 libxcb-cursor0 libportaudio2 gettext
if: "startsWith(matrix.os, 'ubuntu-')"

- name: Test
run: |
poetry run make benchmarks
shell: bash

Expand All @@ -270,7 +280,7 @@ jobs:
- os: macos-latest
- os: windows-latest
- os: ubuntu-20.04
needs: [build, test]
needs: [ build, test ]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
Expand All @@ -288,13 +298,14 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
buzz-*.deb
Buzz*-unix.tar.gz
Buzz*-windows.exe
Buzz*-mac.dmg

deploy_brew_cask:
runs-on: macos-latest
needs: [release]
needs: [ release ]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ mac_app_path := ./dist/Buzz.app
mac_zip_path := ./dist/Buzz-${version}-mac.zip
mac_dmg_path := ./dist/Buzz-${version}-mac.dmg

unix_zip_path := Buzz-${version}-unix.tar.gz

bundle_linux: dist/Buzz
cd dist && tar -czf ${unix_zip_path} Buzz/ && cd -
bash scripts/bundle_linux.sh

bundle_windows: dist/Buzz
iscc //DAppVersion=${version} installer.iss
Expand Down
38 changes: 38 additions & 0 deletions assets/buzz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions assets/buzz.desktop → buzz.desktop
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
[Desktop Entry]

Type=Application

Encoding=UTF-8

Name=Buzz
Comment=Buzz transcribes and translates audio offline on your personal computer
Exec=buzz

Comment=Buzz transcribes and translates audio offline on your personal computer.

Path=/opt/buzz

Exec=/opt/buzz/Buzz

Icon=buzz

Terminal=False
24 changes: 24 additions & 0 deletions scripts/bundle_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-linux-pyinstaller/

PYINSTALLER_BUILD_PATH="dist/Buzz"
PACKAGE_PATH="dist/package"
VERSION=$(poetry version -s)
DEB_PATH="dist/buzz-$VERSION.deb"

mkdir -p $PACKAGE_PATH/opt
mkdir -p $PACKAGE_PATH/usr/share/applications
mkdir -p $PACKAGE_PATH/usr/share/icons/hicolor/scalable/apps

cp -r $PYINSTALLER_BUILD_PATH $PACKAGE_PATH/opt/buzz
cp buzz.desktop $PACKAGE_PATH/usr/share/applications

# Copy icons
cp assets/buzz.svg $PACKAGE_PATH/usr/share/icons/hicolor/scalable/apps/buzz.svg

# Set permissions
find $PACKAGE_PATH/opt/buzz -type f -exec chmod 644 -- {} +
find $PACKAGE_PATH/opt/buzz -type d -exec chmod 755 -- {} +
find $PACKAGE_PATH/usr/share -type f -exec chmod 644 -- {} +
chmod +x $PACKAGE_PATH/opt/buzz/Buzz

fpm -C $PACKAGE_PATH -s dir -t deb -n "buzz" -v $VERSION -p $DEB_PATH