Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed May 1, 2024
1 parent 69fb176 commit 8636c22
Showing 1 changed file with 123 additions and 7 deletions.
130 changes: 123 additions & 7 deletions .github/workflows/build-nuitka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libegl1
- name: mkdir
run: |
mkdir -p dist
mkdir -p upload
- name: Get Information
id: info
Expand Down Expand Up @@ -68,20 +73,131 @@ jobs:
macos-app-icon: "res/img/icon/logo.png"
macos-app-version: ${{ steps.info.outputs.version }}
macos-create-app-bundle: true

- name: Upload Executable

- name: Upload report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ runner.os }} - ${{ matrix.arch }} report
path: |
nuitka-crash-report.xml
report.xml
- 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 \
build/LDDC.app
mv dist/LDDC.dmg upload/LDDC-${{ steps.info.outputs.version }}-${{ steps.arch.outputs.arch }}.dmg
- 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/bin
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 build/LDDC.dist deb/usr/lib/LDDC
chmod +x deb/usr/lib/LDDC/LDDC
ln -s ../lib/LDDC/LDDC 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 "Depends: libxcb-cursor-dev"
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 }}_${{ steps.arch.outputs.arch }}.deb
sudo apt install ./LDDC_${{ steps.info.outputs.version }}_${{ steps.arch.outputs.arch }}.deb

cd ..
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' }}
run: |
New-Item -ItemType Directory -Force -Path dist/exe/main/
New-Item -ItemType Directory -Force -Path dist/exe/main/other/
Copy-Item -Path build/LDDC.dist/LDDC.exe -Destination dist/exe/main/LDDC.exe -Force
Copy-Item -Path build/LDDC.dist/ -Destination dist/exe/other/ -Recurse -Force
Remove-Item -Path dist/exe/other/LDDC.exe -Force
- name: Generate evb
if: ${{ matrix.os == 'windows-latest' }}
uses: chenmozhijin/generate-evb@master
with:
inputExe: "dist/exe/main/LDDC.exe"
outputExe: "dist/exe/output/LDDC/LDDC.exe"
path2Pack: "dist/exe/other/"
evbFilePath: "dist/exe/LDDC.evb"
deleteExtractedOnExit: false
compressFiles: false

- name: create exe
if: ${{ matrix.os == 'windows-latest' }}
run: |
New-Item -Path "dist\exe\chen" -ItemType Directory -Force
New-Item -Path "dist\exe\tools" -ItemType Directory -Force
cd dist/exe/chen
$latest_release = Invoke-RestMethod -Uri "https://api.github.com/repos/dscharrer/innoextract/releases/latest"
$download_url = ($latest_release.assets | Where-Object { $_.browser_download_url -like "*windows.zip" }).browser_download_url
Invoke-WebRequest -Uri $download_url -OutFile "innoextract_windows.zip"
Expand-Archive -Path "innoextract_windows.zip" -DestinationPath "../tools" -Force
$enigmavb_url = "http://enigmaprotector.com/assets/files/enigmavb.exe"
Invoke-WebRequest -Uri $enigmavb_url -OutFile "../tools/enigmavb.exe"
cd ../tools
.\innoextract.exe enigmavb.exe
cd ../../..
dist/exe/tools/app/enigmavbconsole.exe dist/exe/LDDC.evb
- name: Upload dist
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} - ${{ matrix.arch }} Build
path: |
dist/
build/
- name: Compress exe
if: ${{ matrix.os == 'windows-latest' }}
run: |
New-Item -Path upload -ItemType Directory
cd dist/exe/output/
7z a -tzip -mx=9 ../../../upload/LDDC-${{ steps.info.outputs.version }}-windows-${{ steps.arch.outputs.arch }}.zip LDDC
- name: Upload report
- name: Upload
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ runner.os }} - ${{ matrix.arch }} report
name: ${{ runner.os }} - ${{ matrix.arch }} artifacts
path: |
nuitka-crash-report.xml
report.xml
upload/

0 comments on commit 8636c22

Please sign in to comment.