Skip to content

Commit 50efd84

Browse files
committed
fixup! MNT: Windows portable ZIP release (#30)
1 parent be66ae4 commit 50efd84

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,18 @@ jobs:
155155
#- run: dist/*.exe /verysilent /log=installer.log && type installer.log
156156
# shell: bash
157157

158+
- run: choco install zip
158159
- run: packaging/win/create-portable-zip.sh
160+
shell: bash
161+
159162
- uses: actions/upload-artifact@v4
160163
with:
161164
name: Windows installer
162165
path: dist/*.exe
163166
- uses: actions/upload-artifact@v4
164167
with:
165168
name: Windows portable
166-
path: dist/*.zip
169+
path: dist/efck-chat-keyboard/
167170
- uses: softprops/action-gh-release@v2
168171
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
169172
with:

packaging/win/create-portable-zip.sh

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,24 @@ set -eux
55
# It assumes that PyInstaller has already been run and the application
66
# is built in the dist/efck-chat-keyboard directory.
77

8-
# Navigate to the project root
9-
cd "$(dirname "$0")/../../"
10-
118
APP_NAME="efck-chat-keyboard"
129
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"
10+
TARGET_ZIP_FILE="${APP_NAME}-portable-win64.zip"
11+
12+
cd "$DIST_DIR"
13+
rm -vf "$TARGET_ZIP_FILE"
1614

1715
# Check if the source directory exists
18-
if [ ! -d "$PORTABLE_DIR_SOURCE" ]; then
19-
echo "Error: Source directory $PORTABLE_DIR_SOURCE does not exist."
16+
if [ ! -d "$APP_NAME" ]; then
17+
echo "Error: Source directory $DIST_DIR/$APP_NAME does not exist."
2018
echo "Please run PyInstaller first (e.g., pyinstaller packaging/pyinstaller.spec from project root)."
2119
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"
20+
fi >&2
2921

3022
# Create the ZIP archive.
3123
# Change directory to the parent of $APP_NAME (i.e., $DIST_DIR)
3224
# so that the archive contains $APP_NAME as the root folder.
3325
# 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-
26+
zip -r "$TARGET_ZIP_FILE" "$APP_NAME"
3927

40-
echo "Successfully created portable ZIP: $TARGET_ZIP_FILE"
28+
echo "$DIST_DIR/$TARGET_ZIP_FILE"

0 commit comments

Comments
 (0)