Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Feb 20, 2024
1 parent 56ce16c commit 658f7a2
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 27 deletions.
110 changes: 88 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install imageio
pip install Pillow
# pip install imageio
- name: Install EGL
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install libegl1
- name: Install create-dmg
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install create-dmg
- name: Get Information
id: info
Expand All @@ -47,32 +54,91 @@ jobs:
echo "version=$(python setup.py --task get_version)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
#- name: Build Executable
# uses: Nuitka/Nuitka-Action@main
# with:
# nuitka-version: main
# script-name: LDDC.py
# standalone: true
# onefile: false
# enable-plugins: pyside6
# disable-console: true
# product-name: "LDDC"
# file-version: ${{ steps.info.outputs.version }}
# product-version: ${{ steps.info.outputs.version }}
# copyright: ${{ steps.info.outputs.copyright }}

# windows-icon-from-ico: "res/img/icon/logo.png"
# mingw64: true

# macos-app-icon: "res/img/icon/logo.png"
# macos-app-version: ${{ steps.info.outputs.version }}
# macos-create-app-bundle: true

- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: LDDC.py
standalone: true
onefile: false
enable-plugins: pyside6
disable-console: true
product-name: "LDDC"
file-version: ${{ steps.info.outputs.version }}
product-version: ${{ steps.info.outputs.version }}
copyright: ${{ steps.info.outputs.copyright }}

windows-icon-from-ico: "res/img/icon/logo.png"
mingw64: true

macos-app-icon: "res/img/icon/logo.png"
macos-app-version: ${{ steps.info.outputs.version }}
macos-create-app-bundle: true

shell: bash
run: |
if [ ${{ matrix.os == 'ubuntu-latest' }}] || [ ${{ matrix.os == 'windows-latest' }}]
then
icon_filename="logo.ico"
elif [ ${{ matrix.os == 'macos-latest' }}]
then
icon_filename="logo.icns"
fi
pyinstaller --onedir --clean --windowed --name LDDC --specpath dist/spec --distpath dist/dist --workpath dist/build --icon $(pwd)/res/img/icon/$icon_filename LDDC.py
- name: create dmg
if: ${{ matrix.os == 'macos-latest' }}
run: |
create-dmg \
--volname "LDDC" \
--volicon "res/img/icon/logo.icns" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "LDDC.app" 200 190 \
--app-drop-link 600 185 \
dist/LDDC.dmg \
dist/dist/LDDC.app
- name: create deb package
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cd dist
mkdir -p deb/DEBIAN
mkdir -p deb/usr/lib
mkdir -p deb/usr/share/applications
mkdir -p deb/usr/share/icons/
cp -r ../res/img/icon/logo.ico deb/usr/share/icons/LDDC.ico
cp -RT dist/LDDC deb/usr/lib/LDDC
chmod +x deb/usr/lib/LDDC/LDDC
echo "Package: LDDC" >> deb/DEBIAN/control
echo "Version: ${{ steps.info.outputs.version }}" >> deb/DEBIAN/control
echo "Architecture: amd64" >> deb/DEBIAN/control
echo "Maintainer: chenmozhijin" >> deb/DEBIAN/control
echo "Description: lyrics tool" >> deb/DEBIAN/control
echo "[Desktop Entry]" >> deb/usr/share/applications/LDDC.desktop
echo "Name=LDDC" >> deb/usr/share/applications/LDDC.desktop
echo "Comment=lyrics tool" >> deb/usr/share/applications/LDDC.desktop
echo "Exec=/usr/lib/LDDC/LDDC" >> deb/usr/share/applications/LDDC.desktop
echo "Icon=/usr/share/icons/LDDC.ico" >> deb/usr/share/applications/LDDC.desktop
echo "Terminal=false" >> deb/usr/share/applications/LDDC.desktop
echo "Type=Application" >> deb/usr/share/applications/LDDC.desktop
echo "X-Ubuntu-Touch=true" >> deb/usr/share/applications/LDDC.desktop
echo "Categories=Application" >> deb/usr/share/applications/LDDC.desktop
chmod +x deb/usr/share/applications/LDDC.desktop
sudo dpkg -b deb LDDC_${{ steps.info.outputs.version }}_amd64.deb
sudo apt install ./LDDC_${{ steps.info.outputs.version }}_amd64.deb
- name: Upload Executable
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} - ${{ matrix.arch }} Build
path: |
build/
dist/
2 changes: 1 addition & 1 deletion LDDC.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Copyright (c) 2024 沉默の金
__version__ = "v0.3.0"
__version__ = "v0.3.1"
import logging
import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

#### 方式一:从[release](https://github.com/chenmozhijin/LDDC/releases)下载

> [release](https://github.com/chenmozhijin/LDDC/releases)中的版本是通过[nuitka](https://github.com/Nuitka/Nuitka)编译并用[Enigma Virtual Box](https://enigmaprotector.com/en/aboutvb.html)打包的exe
1. 下载[release](https://github.com/chenmozhijin/LDDC/releases)中最新版本的zip压缩包
2. 解压zip包
3. 运行`LDDC.exe`
Expand Down
Binary file added res/img/icon/logo.icns
Binary file not shown.
Binary file added res/img/icon/logo.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion ui/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
Expand Down
2 changes: 1 addition & 1 deletion ui/settings_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def setupUi(self, settings):
self.lyrics_order_listWidget.setSizePolicy(sizePolicy)
self.lyrics_order_listWidget.setMinimumSize(QSize(0, 0))
self.lyrics_order_listWidget.setMaximumSize(QSize(118, 96))
self.lyrics_order_listWidget.setFrameShape(QFrame.StyledPanel)
self.lyrics_order_listWidget.setFrameShape(QFrame.Box)
self.lyrics_order_listWidget.setFrameShadow(QFrame.Sunken)
self.lyrics_order_listWidget.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.lyrics_order_listWidget.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
Expand Down

0 comments on commit 658f7a2

Please sign in to comment.