Skip to content

Commit

Permalink
4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lesserkuma committed Nov 7, 2024
1 parent 8bebc6c commit c7f1688
Show file tree
Hide file tree
Showing 45 changed files with 1,539 additions and 274 deletions.
Binary file modified .github/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/build/Ubuntu/builddata.tar.gz
Binary file not shown.
Binary file added .github/build/Windows/Drivers/CH341/CH341SER.EXE
Binary file not shown.
Binary file added .github/build/Windows/PySide2/Python_3.8.10.7z
Binary file not shown.
82 changes: 82 additions & 0 deletions .github/build/Windows/PySide2/setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "FlashGBX"
#define MyAppVersion "<APP_VERSION>"
#define MyAppPublisher "Lesserkuma"
#define MyAppURL "https://github.com/lesserkuma/FlashGBX"
#define MyAppExeName "FlashGBX-app.exe"
#define MyFilesDir "<FILES_DIR>"
#define MyCH341Dir "<CH341_DIR>"
#define MyOutputDir "<OUTPUT_DIR>"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{060FD4CF-E72F-497D-812E-EB5599D59A0A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} v{#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
;PrivilegesRequiredOverridesAllowed=dialog
OutputDir={#MyOutputDir}
OutputBaseFilename=Setup_FlashGBX
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon={app}\FlashGBX-app.exe
UninstallDisplayName={#MyAppName} v{#MyAppVersion}
PrivilegesRequired=lowest
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Types]
Name: "full"; Description: "Install Application and Drivers"
Name: "custom"; Description: "Custom Installation"; Flags: iscustom

[Components]
Name: "program"; Description: "FlashGBX application"; Types: full custom; Flags: fixed
Name: "driver_ch341"; Description: "CH340/CH341 driver v3.8.2023.02 for GBxCart RW and GBFlash (install/re-install)"; Types: full

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: "{#MyFilesDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: program
Source: "{#MyCH341Dir}\*.*"; DestDir: "{app}\Drivers\CH341"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: driver_ch341
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\Drivers\CH341\CH341SER.EXE"; Description: "Install CH340/CH341 driver"; Flags: waituntilterminated; Components: driver_ch341
Filename: "{app}\Python_3.8.10\python.exe"; Parameters: "-m pip install PySide2==5.15.2.1 --no-warn-script-location --isolated --cache-dir {app}\Python_3.8.10\cache"; StatusMsg: "Setting up prerequisites in embedded Python runtime (only used for FlashGBX)..."; Flags: waituntilterminated runminimized; Components: program
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[InstallDelete]
Type: filesandordirs; Name: "{app}\Python";
Type: filesandordirs; Name: "{app}\Python_3.8.10";
Type: filesandordirs; Name: "{app}\*.pyd";

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
if MsgBox('Delete all config files of FlashGBX as well?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
begin
DelTree(ExpandConstant('{localappdata}\{#MyAppName}'), True, True, True);
end;
end;
end;
Binary file added .github/build/Windows/PySide6/Python_3.10.11.7z
Binary file not shown.
82 changes: 82 additions & 0 deletions .github/build/Windows/PySide6/setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "FlashGBX"
#define MyAppVersion "<APP_VERSION>"
#define MyAppPublisher "Lesserkuma"
#define MyAppURL "https://github.com/lesserkuma/FlashGBX"
#define MyAppExeName "FlashGBX-app.exe"
#define MyFilesDir "<FILES_DIR>"
#define MyCH341Dir "<CH341_DIR>"
#define MyOutputDir "<OUTPUT_DIR>"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{060FD4CF-E72F-497D-812E-EB5599D59A0A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} v{#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
;PrivilegesRequiredOverridesAllowed=dialog
OutputDir={#MyOutputDir}
OutputBaseFilename=Setup_FlashGBX
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon={app}\FlashGBX-app.exe
UninstallDisplayName={#MyAppName} v{#MyAppVersion}
PrivilegesRequired=lowest
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Types]
Name: "full"; Description: "Install Application and Drivers"
Name: "custom"; Description: "Custom Installation"; Flags: iscustom

[Components]
Name: "program"; Description: "FlashGBX application"; Types: full custom; Flags: fixed
Name: "driver_ch341"; Description: "CH340/CH341 driver v3.8.2023.02 for GBxCart RW and GBFlash (install/re-install)"; Types: full

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: "{#MyFilesDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: program
Source: "{#MyCH341Dir}\*.*"; DestDir: "{app}\Drivers\CH341"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: driver_ch341
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\Drivers\CH341\CH341SER.EXE"; Description: "Install CH340/CH341 driver"; Flags: waituntilterminated; Components: driver_ch341
Filename: "{app}\Python_3.10.11\python.exe"; Parameters: "-m pip install PySide6==6.5.0 --no-warn-script-location --isolated --cache-dir {app}\Python_3.10.11\cache"; StatusMsg: "Setting up prerequisites in embedded Python runtime (only used for FlashGBX)..."; Flags: waituntilterminated runminimized; Components: program
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[InstallDelete]
Type: filesandordirs; Name: "{app}\Python";
Type: filesandordirs; Name: "{app}\Python_3.10.11";
Type: filesandordirs; Name: "{app}\*.pyd";

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
if MsgBox('Delete all config files of FlashGBX as well?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
begin
DelTree(ExpandConstant('{localappdata}\{#MyAppName}'), True, True, True);
end;
end;
end;
51 changes: 51 additions & 0 deletions .github/build/macOS/FlashGBX.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['run.py'],
pathex=[],
binaries=[('FlashGBX/res/icon.ico', 'res')],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)

pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='FlashGBX',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
icon=['FlashGBX/res/icon.ico'],
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='FlashGBX',
)
info_plist = {
'CFBundleName': 'FlashGBX',
'CFBundleDisplayName': 'FlashGBX',
'CFBundleGetInfoString': 'Interface software for GB/GBC/GBA cart readers',
'CFBundleShortVersionString': '<APP_VERSION>',
'CFBundleIdentifier': 'com.lesserkuma.FlashGBX',
}
app = BUNDLE(
coll,
name='FlashGBX.app',
icon='FlashGBX/res/icon.ico',
bundle_identifier='com.lesserkuma.FlashGBX',
info_plist=info_plist,
)
118 changes: 118 additions & 0 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: macOS

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
VERSION: ${{ github.event.release.tag_name || '0.0' }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
arch: arm64
- os: macos-13
arch: x86_64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create directory for Python packages
run: |
mkdir -p ${{ github.workspace }}/venv
- name: Cache Python packages
id: cache-pip
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/venv
key: flashgbx-macos-${{ matrix.arch }}-python-dependencies-2024110401
restore-keys: |
flashgbx-macos-${{ matrix.arch }}-python-dependencies-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install Python packages
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
python -m venv ${{ github.workspace }}/venv
source ${{ github.workspace }}/venv/bin/activate
python -m pip install pyinstaller==6.11.0 Pillow==10.3.0 PySide6==6.7.2 pyserial==3.5 python-dateutil==2.9.0.post0 requests==2.32.3
- name: Build FlashGBX
run: |
cd "${{ github.workspace }}"
cp ".github/build/macOS/FlashGBX.spec" .
sed -i '' 's/<APP_VERSION>/${{ env.VERSION }}/g' "./FlashGBX.spec"
rm -r FlashGBX/config
source ${{ github.workspace }}/venv/bin/activate
pyinstaller FlashGBX.spec
mkdir dist/FlashGBX.app/Contents/MacOS/config
mkdir dist/FlashGBX.app/Contents/MacOS/res
cp -r FlashGBX/res/* dist/FlashGBX.app/Contents/MacOS/res
- name: Create DMG
run: |
brew install create-dmg
mkdir -p "${{ github.workspace }}/dist/dmg"
cp -r "${{ github.workspace }}/dist/FlashGBX.app" "${{ github.workspace }}/dist/dmg"
dmg_path="${{ github.workspace }}/dist/FlashGBX_${{ env.VERSION }}_macOS-${{ matrix.arch }}.dmg"
max_retries=5
retry_delay=10
for attempt in $(seq 1 $max_retries); do
if create-dmg \
--volname "FlashGBX" \
--volicon "${{ github.workspace }}/FlashGBX/res/icon.ico" \
--window-pos 200 120 \
--window-size 600 300 \
--icon-size 100 \
--icon "FlashGBX.app" 175 120 \
--hide-extension "FlashGBX.app" \
--app-drop-link 425 120 \
"$dmg_path" \
"${{ github.workspace }}/dist/dmg/"; then
echo "Successfully created image of FlashGBX v${{ env.VERSION }}."
break
else
echo "Failed to create DMG (attempt $attempt/$max_retries). Retrying in $retry_delay seconds..."
sleep $retry_delay
fi

if [[ $attempt -eq $max_retries ]]; then
echo "Error: Failed to create DMG after $max_retries attempts."
exit 1
fi
done

- name: Create artifact
if: env.VERSION == '0.0'
uses: actions/upload-artifact@v4
with:
name: FlashGBX_macOS-${{ matrix.arch }}
path: ${{ github.workspace }}/dist/FlashGBX_${{ env.VERSION }}_macOS-${{ matrix.arch }}.dmg

- name: Upload release asset
if: env.VERSION != '0.0'
uses: softprops/action-gh-release@v2.0.8
with:
tag_name: ${{ github.event.release.tag_name }}
files: ${{ github.workspace }}/dist/FlashGBX_${{ env.VERSION }}_macOS-${{ matrix.arch }}.dmg
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Ubuntu

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERSION: ${{ github.event.release.tag_name || '0.0' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract build data
run: |
mkdir -p "${{ github.workspace }}/dist/deb"
tar xzf ".github/build/Ubuntu/builddata.tar.gz" -C "${{ github.workspace }}/dist/deb"
sed -i 's/<APP_VERSION>/${{ env.VERSION }}/g' "${{ github.workspace }}/dist/deb/DEBIAN/control"
- name: Move FlashGBX files into deb build folder
run: |
rm -r "${{ github.workspace }}/FlashGBX/config"
mv "${{ github.workspace }}/FlashGBX" "${{ github.workspace }}/dist/deb"
- name: Install tools
run: |
sudo apt install devscripts dh-make debhelper
- name: Create DEB file
run: |
cd "${{ github.workspace }}/dist/deb"
dpkg-deb --build . "../FlashGBX_${{ env.VERSION }}_Ubuntu-all.deb"
- name: Create artifact
if: env.VERSION == '0.0'
uses: actions/upload-artifact@v4
with:
name: FlashGBX_Ubuntu-all
path: ${{ github.workspace }}/dist/FlashGBX_${{ env.VERSION }}_Ubuntu-all.deb

- name: Upload release asset
if: env.VERSION != '0.0'
uses: softprops/action-gh-release@v2.0.8
with:
tag_name: ${{ github.event.release.tag_name }}
files: ${{ github.workspace }}/dist/FlashGBX_${{ env.VERSION }}_Ubuntu-all.deb
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit c7f1688

Please sign in to comment.