Skip to content

Commit 2ed8bc8

Browse files
authored
Refactor keystore handling and installer script
Refactor build.yml to streamline keystore and installer setup
1 parent f76fe22 commit 2ed8bc8

1 file changed

Lines changed: 69 additions & 70 deletions

File tree

.github/workflows/build.yml

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,13 @@ jobs:
129129
if [ -n "$KEYSTORE_BASE64" ]; then
130130
echo "$KEYSTORE_BASE64" | base64 --decode > android/app/upload-keystore.jks
131131
cat > android/key.properties <<EOF
132-
storeFile=${{ github.workspace }}/android/app/upload-keystore.jks
133-
keyAlias=$KEY_ALIAS
134-
storePassword=$STORE_PASSWORD
135-
keyPassword=$KEY_PASSWORD
136-
EOF
132+
storeFile=${{ github.workspace }}/android/app/upload-keystore.jks
133+
keyAlias=$KEY_ALIAS
134+
storePassword=$STORE_PASSWORD
135+
keyPassword=$KEY_PASSWORD
136+
EOF
137137
fi
138138

139-
140139
- name: Get dependencies
141140
run: flutter pub get
142141

@@ -243,28 +242,28 @@ jobs:
243242
run: |
244243
choco install innosetup -y
245244
@"
246-
[Setup]
247-
AppName=OpenlibExtended
248-
AppVersion=${{ needs.prepare.outputs.version }}
249-
AppPublisher=warreth
250-
DefaultDirName={autopf}\OpenlibExtended
251-
DefaultGroupName=OpenlibExtended
252-
OutputDir=artifacts
253-
OutputBaseFilename=openlibextended-windows-x64-${{ needs.prepare.outputs.version }}
254-
Compression=lzma
255-
SolidCompression=yes
256-
ArchitecturesInstallIn64BitMode=x64compatible
257-
258-
[Files]
259-
Source: "build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
260-
261-
[Icons]
262-
Name: "{group}\OpenlibExtended"; Filename: "{app}\OpenlibExtended.exe"
263-
Name: "{commondesktop}\OpenlibExtended"; Filename: "{app}\OpenlibExtended.exe"
264-
265-
[Run]
266-
Filename: "{app}\OpenlibExtended.exe"; Description: "Launch OpenlibExtended"; Flags: nowait postinstall skipifsilent
267-
"@ | Out-File -FilePath "installer.iss" -Encoding UTF8
245+
[Setup]
246+
AppName=OpenlibExtended
247+
AppVersion=${{ needs.prepare.outputs.version }}
248+
AppPublisher=warreth
249+
DefaultDirName={autopf}\OpenlibExtended
250+
DefaultGroupName=OpenlibExtended
251+
OutputDir=artifacts
252+
OutputBaseFilename=openlibextended-windows-x64-${{ needs.prepare.outputs.version }}
253+
Compression=lzma
254+
SolidCompression=yes
255+
ArchitecturesInstallIn64BitMode=x64compatible
256+
257+
[Files]
258+
Source: "build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
259+
260+
[Icons]
261+
Name: "{group}\OpenlibExtended"; Filename: "{app}\OpenlibExtended.exe"
262+
Name: "{commondesktop}\OpenlibExtended"; Filename: "{app}\OpenlibExtended.exe"
263+
264+
[Run]
265+
Filename: "{app}\OpenlibExtended.exe"; Description: "Launch OpenlibExtended"; Flags: nowait postinstall skipifsilent
266+
"@ | Out-File -FilePath "installer.iss" -Encoding UTF8
268267
mkdir artifacts
269268
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer.iss
270269

@@ -314,25 +313,25 @@ jobs:
314313
fi
315314
cp assets/icons/appIcon_foreground.png AppDir/usr/share/icons/hicolor/256x256/apps/openlibextended.png
316315
cp assets/icons/appIcon_foreground.png AppDir/openlibextended.png
317-
cat > AppDir/openlibextended.desktop << 'EOF'
318-
[Desktop Entry]
319-
Name=OpenlibExtended
320-
Comment=Download and read books from shadow library
321-
Exec=openlibextended
322-
Icon=openlibextended
323-
Type=Application
324-
Categories=Education;Literature;
325-
Keywords=books;library;epub;pdf;reader;
326-
EOF
316+
cat > AppDir/openlibextended.desktop <<'EOF'
317+
[Desktop Entry]
318+
Name=OpenlibExtended
319+
Comment=Download and read books from shadow library
320+
Exec=openlibextended
321+
Icon=openlibextended
322+
Type=Application
323+
Categories=Education;Literature;
324+
Keywords=books;library;epub;pdf;reader;
325+
EOF
327326
cp AppDir/openlibextended.desktop AppDir/usr/share/applications/
328-
cat > AppDir/AppRun << 'EOF'
329-
#!/bin/bash
330-
SELF=$(readlink -f "$0")
331-
HERE=${SELF%/*}
332-
export PATH="${HERE}/usr/bin/:${PATH}"
333-
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
334-
exec "${HERE}/usr/bin/openlibextended" "$@"
335-
EOF
327+
cat > AppDir/AppRun <<'EOF'
328+
#!/bin/bash
329+
SELF=$(readlink -f "$0")
330+
HERE=${SELF%/*}
331+
export PATH="${HERE}/usr/bin/:${PATH}"
332+
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
333+
exec "${HERE}/usr/bin/openlibextended" "$@"
334+
EOF
336335
chmod +x AppDir/AppRun
337336
ARCH=x86_64 ./appimagetool-x86_64.AppImage --no-appstream AppDir artifacts/openlibextended-linux-x64-${{ needs.prepare.outputs.version }}.AppImage
338337

@@ -373,30 +372,30 @@ jobs:
373372
374373
- name: Create Flatpak manifest
375374
run: |
376-
cat > dev.wath.openlibextended.yml << EOF
377-
app-id: dev.wath.openlibextended
378-
runtime: org.freedesktop.Platform
379-
runtime-version: '24.08'
380-
sdk: org.freedesktop.Sdk
381-
command: openlibextended
382-
finish-args:
383-
- --share=ipc
384-
- --socket=fallback-x11
385-
- --socket=wayland
386-
- --device=dri
387-
- --share=network
388-
- --filesystem=home
389-
modules:
390-
- name: openlibextended
391-
buildsystem: simple
392-
build-commands:
393-
- cp -r bundle /app/
394-
- ln -s /app/bundle/OpenlibExtended /app/bin/openlibextended
395-
sources:
396-
- type: dir
397-
path: build/linux/x64/release/bundle
398-
dest: bundle
399-
EOF
375+
cat > dev.wath.openlibextended.yml <<EOF
376+
app-id: dev.wath.openlibextended
377+
runtime: org.freedesktop.Platform
378+
runtime-version: '24.08'
379+
sdk: org.freedesktop.Sdk
380+
command: openlibextended
381+
finish-args:
382+
- --share=ipc
383+
- --socket=fallback-x11
384+
- --socket=wayland
385+
- --device=dri
386+
- --share=network
387+
- --filesystem=home
388+
modules:
389+
- name: openlibextended
390+
buildsystem: simple
391+
build-commands:
392+
- cp -r bundle /app/
393+
- ln -s /app/bundle/OpenlibExtended /app/bin/openlibextended
394+
sources:
395+
- type: dir
396+
path: build/linux/x64/release/bundle
397+
dest: bundle
398+
EOF
400399

401400
- name: Build Flatpak
402401
uses: flatpak/flatpak-github-actions/flatpak-builder@v6

0 commit comments

Comments
 (0)