add app icon
This commit is contained in:
parent
b679545e26
commit
8021421018
4 changed files with 55 additions and 10 deletions
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
|
|
@ -34,7 +34,15 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pyinstaller
|
pip install pyinstaller Pillow
|
||||||
|
|
||||||
|
- name: Convert Icon to ICO (Windows)
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
from PIL import Image
|
||||||
|
img = Image.open('fluxer-reaper-icon.png')
|
||||||
|
img.save('fluxer-reaper-icon.ico', format='ICO', sizes=[(256, 256)])
|
||||||
|
|
||||||
- name: Build with PyInstaller
|
- name: Build with PyInstaller
|
||||||
run: pyinstaller fluxer-reaper.spec
|
run: pyinstaller fluxer-reaper.spec
|
||||||
|
|
@ -42,23 +50,55 @@ jobs:
|
||||||
- name: Prepare Release Asset (Linux)
|
- name: Prepare Release Asset (Linux)
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
chmod +x ${{ matrix.executable_path }}
|
mkdir discord-reaper
|
||||||
mkdir -p ${{ matrix.artifact_name }}
|
cp ${{ matrix.executable_path }} discord-reaper/
|
||||||
cp ${{ matrix.executable_path }} ${{ matrix.artifact_name }}/
|
chmod +x discord-reaper/fluxer-reaper
|
||||||
zip -r ${{ matrix.asset_name }} ${{ matrix.artifact_name }}
|
zip -r ${{ matrix.asset_name }} discord-reaper/
|
||||||
|
|
||||||
|
# Prepare AppImage
|
||||||
|
mkdir -p AppDir/usr/bin
|
||||||
|
cp ${{ matrix.executable_path }} AppDir/usr/bin/fluxer-reaper
|
||||||
|
cp fluxer-reaper-icon.png AppDir/fluxer-reaper.png
|
||||||
|
|
||||||
|
# Create desktop file
|
||||||
|
cat << 'EOF' > AppDir/fluxer-reaper.desktop
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=Discord Reaper
|
||||||
|
Exec=fluxer-reaper
|
||||||
|
Icon=fluxer-reaper
|
||||||
|
Categories=Utility;
|
||||||
|
Terminal=true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create AppRun script
|
||||||
|
cat << 'EOF' > AppDir/AppRun
|
||||||
|
#!/bin/bash
|
||||||
|
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||||
|
export PATH="${HERE}/usr/bin:${PATH}"
|
||||||
|
exec fluxer-reaper "$@"
|
||||||
|
EOF
|
||||||
|
chmod +x AppDir/AppRun
|
||||||
|
|
||||||
|
# Download appimagetool
|
||||||
|
curl -LO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||||
|
chmod +x appimagetool-x86_64.AppImage
|
||||||
|
./appimagetool-x86_64.AppImage AppDir fluxer-reaper-x86_64.AppImage
|
||||||
|
|
||||||
- name: Prepare Release Asset (Windows)
|
- name: Prepare Release Asset (Windows)
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ matrix.artifact_name }}
|
mkdir discord-reaper
|
||||||
cp ${{ matrix.executable_path }} ${{ matrix.artifact_name }}/
|
copy ${{ matrix.executable_path }} discord-reaper\
|
||||||
powershell Compress-Archive -Path "${{ matrix.artifact_name }}" -DestinationPath "${{ matrix.asset_name }}"
|
powershell Compress-Archive -Path "discord-reaper" -DestinationPath "${{ matrix.asset_name }}"
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact_name }}
|
name: ${{ matrix.artifact_name }}
|
||||||
path: ${{ matrix.asset_name }}
|
path: |
|
||||||
|
${{ matrix.asset_name }}
|
||||||
|
fluxer-reaper-x86_64.AppImage
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
|
|
@ -76,6 +116,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
artifacts/fluxer-reaper-linux/fluxer-reaper-linux.zip
|
artifacts/fluxer-reaper-linux/fluxer-reaper-linux.zip
|
||||||
|
artifacts/fluxer-reaper-linux/fluxer-reaper-x86_64.AppImage
|
||||||
artifacts/fluxer-reaper-windows/fluxer-reaper-windows.zip
|
artifacts/fluxer-reaper-windows/fluxer-reaper-windows.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -37,3 +37,5 @@ state.json
|
||||||
|
|
||||||
# Temporary Test Scripts
|
# Temporary Test Scripts
|
||||||
test_*.py
|
test_*.py
|
||||||
|
test_release.zip
|
||||||
|
test_release/
|
||||||
|
|
|
||||||
BIN
fluxer-reaper-icon.png
Normal file
BIN
fluxer-reaper-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
|
|
@ -1,4 +1,5 @@
|
||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
import os
|
||||||
from PyInstaller.utils.hooks import collect_submodules
|
from PyInstaller.utils.hooks import collect_submodules
|
||||||
|
|
||||||
hiddenimports = []
|
hiddenimports = []
|
||||||
|
|
@ -24,6 +25,7 @@ exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
a.datas,
|
a.datas,
|
||||||
[],
|
[],
|
||||||
name='fluxer-reaper',
|
name='fluxer-reaper',
|
||||||
|
|
@ -39,5 +41,5 @@ exe = EXE(
|
||||||
target_arch=None,
|
target_arch=None,
|
||||||
codesign_identity=None,
|
codesign_identity=None,
|
||||||
entitlements_file=None,
|
entitlements_file=None,
|
||||||
icon='fluxer-reaper-icon.png',
|
icon='fluxer-reaper-icon.ico' if os.name == 'nt' else 'fluxer-reaper-icon.png',
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue