Skip to content

Commit

Permalink
feat: Add fcitx5 support for linux version #15
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Oct 6, 2024
1 parent 5161385 commit 1dc3bb1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/build-nuitka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
run: |
echo "copyright=Copyright (C) $(python build_helper.py --task get_year) 沉默の金" >> $GITHUB_OUTPUT
echo "version=$(python build_helper.py --task get_version)" >> $GITHUB_OUTPUT
echo "num_version=$(python build_helper.py --task get_num_version)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Build Executable(Linux/macOS)
Expand All @@ -102,14 +103,14 @@ jobs:
report: nuitka-report.xml
enable-plugins: pyside6
product-name: "LDDC"
file-version: ${{ steps.info.outputs.version }}
product-version: ${{ steps.info.outputs.version }}
file-version: ${{ steps.info.outputs.num_version }}
product-version: ${{ steps.info.outputs.num_version }}
copyright: ${{ steps.info.outputs.copyright }}

disable-console: true

macos-app-icon: "LDDC/res/img/icon/logo.icns"
macos-app-version: ${{ steps.info.outputs.version }}
macos-app-version: ${{ steps.info.outputs.num_version }}
macos-create-app-bundle: true
macos-target-arch: ${{ steps.arch.outputs.nuitka_arch }}
env:
Expand All @@ -127,8 +128,8 @@ jobs:
report: nuitka-report.xml
enable-plugins: pyside6
product-name: "LDDC"
file-version: ${{ steps.info.outputs.version }}
product-version: ${{ steps.info.outputs.version }}
file-version: ${{ steps.info.outputs.num_version }}
product-version: ${{ steps.info.outputs.num_version }}
copyright: ${{ steps.info.outputs.copyright }}

windows-icon-from-ico: "LDDC/res/img/icon/logo.ico"
Expand Down Expand Up @@ -162,6 +163,12 @@ jobs:
mv dist/LDDC.dmg upload/LDDC-${{ steps.info.outputs.version }}-${{ steps.arch.outputs.arch }}.dmg
- name: Add fcitx5 support
if: ${{ runner.os == 'Linux' }}
uses: chenmozhijin/fcitx5-pyside@master
with:
plugins-path: ../build/LDDC.dist/PySide6/qt-plugins

- name: create deb package
if: ${{ runner.os == 'Linux' }}
run: |
Expand All @@ -172,19 +179,21 @@ jobs:
mkdir -p deb/usr/share/applications
mkdir -p deb/usr/share/icons/
cp -r ../LDDC/res/img/icon/logo.ico deb/usr/share/icons/LDDC.ico
cp ./LICENSE deb/usr/share/doc/LDDC/
cp -RT ../build/LDDC.dist deb/usr/lib/LDDC
chmod +x deb/usr/lib/LDDC/LDDC.bin
ln -s ../lib/LDDC/LDDC.bin deb/usr/bin/LDDC
echo "Package: LDDC" >> deb/DEBIAN/control
echo "Version: ${{ steps.info.outputs.version }}" >> deb/DEBIAN/control
echo "Architecture: ${{ steps.arch.outputs.arch }}" >> deb/DEBIAN/control
echo "Maintainer: chenmozhijin" >> deb/DEBIAN/control
echo "Description: lyrics tool" >> deb/DEBIAN/control
echo "Maintainer: chenmozhijin <[email protected]>" >> deb/DEBIAN/control
echo "Description: Lyrics acquisition tool" >> deb/DEBIAN/control
echo "Homepage: https://github.com/chenmozhijin/LDDC" >> 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 "Comment=Lyrics acquisition tool" >> deb/usr/share/applications/LDDC.desktop
echo "Exec=/usr/bin/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
Expand Down
2 changes: 1 addition & 1 deletion LDDC/utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""版本信息与处理模块"""

__version__ = "v0.8.0-alpha.0"
__version__ = "v0.8.0-alpha.1"
import re
from typing import Literal

Expand Down
6 changes: 4 additions & 2 deletions build_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
parser.add_argument('--task', choices=['get_version', 'get_year'], required=True)
arg = parser.parse_args()

version = ".".join(str(i) for i in parse_version(__version__)[:3])
num_version = ".".join(str(i) for i in parse_version(__version__)[:3])

year = time.strftime("%Y")
if year != '2024':
year = "2024-" + year

match arg.task:
case 'get_version':
print(version)
print(__version__)
case 'get_num_version':
print(num_version)
case 'get_year':
print(year)

0 comments on commit 1dc3bb1

Please sign in to comment.