Add DEB bundle (#483)

This commit is contained in:
Chidi Williams 2023-06-06 09:31:53 +01:00 committed by GitHub
commit c1d90bf0c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 108 additions and 28 deletions

View file

@ -63,15 +63,14 @@ jobs:
- name: Install dependencies
run: poetry install
- 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: Test
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
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
@ -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
@ -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 }}
@ -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 }}
@ -238,15 +249,14 @@ jobs:
- name: Install dependencies
run: poetry install
- 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: Test
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
poetry run make benchmarks
shell: bash
@ -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
@ -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

View file

@ -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

38
assets/buzz.svg Normal file
View file

@ -0,0 +1,38 @@
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_1_2)">
<rect x="100" y="100" width="824" height="824" rx="184" fill="#CD0000"/>
<rect x="100" y="100" width="824" height="824" rx="184" fill="url(#paint0_linear_1_2)"/>
</g>
<g filter="url(#filter1_d_1_2)">
<circle cx="512" cy="512" r="290" stroke="white" stroke-width="40"/>
<circle cx="512" cy="512" r="224" fill="url(#paint1_radial_1_2)"/>
</g>
<defs>
<filter id="filter0_d_1_2" x="78" y="89" width="868" height="868" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="11"/>
<feGaussianBlur stdDeviation="11"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.28 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_2"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_2" result="shape"/>
</filter>
<filter id="filter1_d_1_2" x="196" y="196" width="636" height="636" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="4"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.216667 0 0 0 0 0.216667 0 0 0 0 0.216667 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_2"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_2" result="shape"/>
</filter>
<linearGradient id="paint0_linear_1_2" x1="512" y1="100" x2="512" y2="924" gradientUnits="userSpaceOnUse">
<stop stop-color="#CD0000" stop-opacity="0"/>
<stop offset="1" stop-opacity="0.2"/>
</linearGradient>
<radialGradient id="paint1_radial_1_2" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(449.28 457.68) rotate(45) scale(302.529 345.057)">
<stop offset="0.578998" stop-color="white"/>
<stop offset="0.873177" stop-color="#E6E6E6"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -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
scripts/bundle_linux.sh Normal file
View file

@ -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