Skip to content

Commit 9b24bed

Browse files
MNT: Windows portable ZIP release (#30)
* feat: Windows portable ZIP release Fixes #20 * Update .github/workflows/ci.yml * Update .github/workflows/ci.yml * Update .github/workflows/ci.yml * Update .github/workflows/ci.yml --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent f8eba3d commit 9b24bed

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,22 @@ jobs:
154154
# FIXME: /verysilent not respected? The window shows, hangs.
155155
#- run: dist/*.exe /verysilent /log=installer.log && type installer.log
156156
# shell: bash
157+
158+
- run: packaging/win/create-portable-zip.sh
157159
- uses: actions/upload-artifact@v4
158160
with:
159161
name: Windows installer
160162
path: dist/*.exe
163+
- uses: actions/upload-artifact@v4
164+
with:
165+
name: Windows portable
166+
path: dist/*.zip
161167
- uses: softprops/action-gh-release@v2
162168
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
163169
with:
164-
files: dist/*.exe
170+
files: |
171+
dist/*.exe
172+
dist/*.zip
165173
166174
package-macos:
167175
timeout-minutes: 10
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
set -eux
3+
4+
# This script creates a portable ZIP archive for the Windows version of EFCK.
5+
# It assumes that PyInstaller has already been run and the application
6+
# is built in the dist/efck-chat-keyboard directory.
7+
8+
# Navigate to the project root
9+
cd "$(dirname "$0")/../../"
10+
11+
APP_NAME="efck-chat-keyboard"
12+
DIST_DIR="dist"
13+
PORTABLE_DIR_SOURCE="$DIST_DIR/$APP_NAME" # This is the folder created by PyInstaller's COLLECT
14+
TARGET_ZIP_FILE_BASENAME="${APP_NAME}-portable-win"
15+
TARGET_ZIP_FILE="$DIST_DIR/${TARGET_ZIP_FILE_BASENAME}.zip"
16+
17+
# Check if the source directory exists
18+
if [ ! -d "$PORTABLE_DIR_SOURCE" ]; then
19+
echo "Error: Source directory $PORTABLE_DIR_SOURCE does not exist."
20+
echo "Please run PyInstaller first (e.g., pyinstaller packaging/pyinstaller.spec from project root)."
21+
exit 1
22+
fi
23+
24+
echo "Source directory: $(pwd)/$PORTABLE_DIR_SOURCE"
25+
echo "Target ZIP file: $(pwd)/$TARGET_ZIP_FILE"
26+
27+
# Remove old zip file if it exists
28+
rm -f "$TARGET_ZIP_FILE"
29+
30+
# Create the ZIP archive.
31+
# Change directory to the parent of $APP_NAME (i.e., $DIST_DIR)
32+
# so that the archive contains $APP_NAME as the root folder.
33+
# This way, when the user extracts, they get a single folder.
34+
(cd "$DIST_DIR" && zip -r "${TARGET_ZIP_FILE_BASENAME}.zip" "$APP_NAME" -x "*/.DS_Store" "*/__MACOSX")
35+
36+
# To create a zip where contents of $PORTABLE_DIR_SOURCE are at the root of the zip:
37+
# (cd "$PORTABLE_DIR_SOURCE" && zip -r "../${TARGET_ZIP_FILE_BASENAME}.zip" . -x ".DS_Store" "__MACOSX")
38+
39+
40+
echo "Successfully created portable ZIP: $TARGET_ZIP_FILE"

0 commit comments

Comments
 (0)