Skip to content

Commit

Permalink
Merge pull request #8 from chenmozhijin/dev
Browse files Browse the repository at this point in the history
v7.0.0
  • Loading branch information
chenmozhijin authored Aug 17, 2024
2 parents 9b57e3f + 2d3120f commit be7b7d9
Show file tree
Hide file tree
Showing 96 changed files with 12,933 additions and 6,723 deletions.
64 changes: 46 additions & 18 deletions .github/workflows/build-nuitka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-13, ubuntu-latest, windows-latest]
arch: [x64]
include:
- os: macos-latest
Expand All @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
architecture: ${{ matrix.arch }}

- name: Get arch
Expand All @@ -53,21 +53,28 @@ jobs:
pip install imageio
- name: Install EGL/upx
if: ${{ matrix.os == 'ubuntu-latest' }}
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libegl1 upx
- name: Install create-dmg/upx
if: ${{ matrix.os == 'macos-latest' }}
if: ${{ runner.os == 'macOS' }}
run: |
brew install create-dmg upx
- name: Install upx/7zip
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ runner.os == 'Windows' }}
run: |
choco install upx 7zip -y
# Remove problematic brew libs if Intel Mac https://github.com/Nuitka/Nuitka/issues/2853#issuecomment-2119520735
- name: Remove problematic brew libs
run: |
brew remove --force --ignore-dependencies openssl@3
brew cleanup openssl@3
if: runner.os == 'macOS' && runner.arch == 'X64'

- name: mkdir
run: |
mkdir -p dist
Expand All @@ -77,32 +84,49 @@ jobs:
id: info
shell: bash
run: |
echo "copyright=Copyright (C) $(python setup.py --task get_year) 沉默の金" >> $GITHUB_OUTPUT
echo "version=$(python setup.py --task get_version)" >> $GITHUB_OUTPUT
echo "copyright=Copyright (C) $(python build_helper.py --task get_year) 沉默の金" >> $GITHUB_OUTPUT
echo "version=$(python build_helper.py --task get_version)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
if : ${{ runner.os == 'Linux' || runner.os == 'macOS'}}
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
disable-console: true

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

- name: Build Executable
uses: Nuitka/Nuitka-Action@main
if : ${{ runner.os == 'Windows' }}
with:
nuitka-version: main
script-name: LDDC.py
standalone: true
onefile: false
enable-plugins: pyside6
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
windows-console-mode: 'attach'

- name: Upload report
uses: actions/upload-artifact@v4
if: success() || failure()
Expand All @@ -113,7 +137,7 @@ jobs:
report.xml
- name: create dmg
if: ${{ matrix.os == 'macos-latest' }}
if: ${{ runner.os == 'macOS' }}
run: |
create-dmg \
--volname "LDDC" \
Expand All @@ -129,7 +153,7 @@ jobs:
mv dist/LDDC.dmg upload/LDDC-${{ steps.info.outputs.version }}-${{ steps.arch.outputs.arch }}.dmg
- name: create deb package
if: ${{ matrix.os == 'ubuntu-latest' }}
if: ${{ runner.os == 'Linux' }}
run: |
cd dist
mkdir -p deb/DEBIAN
Expand All @@ -146,7 +170,6 @@ jobs:
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 "Depends: libxcb-cursor-dev"
echo "Description: lyrics tool" >> deb/DEBIAN/control

echo "[Desktop Entry]" >> deb/usr/share/applications/LDDC.desktop
Expand All @@ -167,7 +190,7 @@ jobs:
mv dist/LDDC_${{ steps.info.outputs.version }}_${{ steps.arch.outputs.arch }}.deb upload/LDDC_${{ steps.info.outputs.version }}_${{ steps.arch.outputs.arch }}.deb

- name: prepare create exe
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ runner.os == 'Windows' }}
run: |
New-Item -ItemType Directory -Force -Path dist/exe/main/
New-Item -ItemType Directory -Force -Path dist/exe/main/other/
Expand All @@ -176,7 +199,7 @@ jobs:
Remove-Item -Path dist/exe/other/LDDC.exe -Force
- name: Generate evb
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ runner.os == 'Windows' }}
uses: chenmozhijin/generate-evb@master
with:
inputExe: "dist/exe/main/LDDC.exe"
Expand All @@ -187,7 +210,7 @@ jobs:
compressFiles: false

- name: create exe
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ runner.os == 'Windows' }}
run: |
New-Item -Path "dist\exe\chen" -ItemType Directory -Force
New-Item -Path "dist\exe\tools" -ItemType Directory -Force
Expand Down Expand Up @@ -218,10 +241,15 @@ jobs:
build/
- name: Compress exe
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ runner.os == 'Windows' }}
run: |
cd dist/exe/output/
7z a -tzip -mx=9 ../../../upload/LDDC-${{ steps.info.outputs.version }}-windows-${{ steps.arch.outputs.arch }}.zip LDDC
7z a -tzip -mx=9 ../../../upload/LDDC-${{ steps.info.outputs.version }}-windows-${{ steps.arch.outputs.arch }}-onefile.zip LDDC
cd ../../..
Rename-Item -Path "build/LDDC.dist" -NewName "LDDC"
cd build
7z a -tzip -mx=9 ../upload/LDDC-${{ steps.info.outputs.version }}-windows-${{ steps.arch.outputs.arch }}.zip LDDC
- name: Upload
uses: actions/upload-artifact@v4
Expand Down
Loading

0 comments on commit be7b7d9

Please sign in to comment.