xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 08adb7774116621c4304c0717855f4926942fdb8

Make scripts/release-win build regular Windows zip
This involves:
1. Pulling tags on the remote side.
2. Verifying the tag points at the right commit.
3. Checking out the tag.
4. Building Windows version remotely.
5. Checking bitness of binaries just in case.
Author: xaizek
Author date (UTC): 2025-05-03 12:10
Committer name: xaizek
Committer date (UTC): 2025-05-03 12:10
Parent(s): 56c009bedd5c689f58c0d9b2ba733429da6a1123
Signing key: 99DC5E4DB05F6BE2
Tree: 02dc60b6a0961d49d9c39fef6d7feb6d1f68a1df
File Lines added Lines deleted
scripts/release-win 50 7
File scripts/release-win changed (mode: 100755) (index cfecb0a7e..4710733e6)
... ... W32_DIR="${W32_DIR:-../vifm-mxe-w32/}"
46 46 W64_DIR="${W64_DIR:-../vifm-mxe-w64}" W64_DIR="${W64_DIR:-../vifm-mxe-w64}"
47 47 MXE_BUILD_SCR="${MXE_BUILD_SCR:-../build-mxe-vifm}" MXE_BUILD_SCR="${MXE_BUILD_SCR:-../build-mxe-vifm}"
48 48
49 echo ::: PREPARING WINDOWS REPOSITORY... :::
50
51 ssh "$REMOTE_NAME" bash - << EOF
52 set -eu
53
54 cd "$REMOTE_DIR/"
55 if ! git diff --quiet; then
56 echo "Windows repository contains changes. Aborting."
57 exit 1
58 fi
59
60 # pull remote tags discarding any conflicting local ones
61 git fetch --tags --force
62
63 if [ "\$(git rev-parse "$tag")" != "$commit" ]; then
64 echo "Windows repository resolves tag differently. Aborting."
65 exit 1
66 fi
67
68 git checkout "$tag"
69 EOF
70
49 71 echo ::: BUILDING... ::: echo ::: BUILDING... :::
50 72
51 73 ( cd "$W32_DIR" && "$MXE_BUILD_SCR" --32 "$tag" ) ( cd "$W32_DIR" && "$MXE_BUILD_SCR" --32 "$tag" )
52 74 ( cd "$W64_DIR" && "$MXE_BUILD_SCR" --64 "$tag" ) ( cd "$W64_DIR" && "$MXE_BUILD_SCR" --64 "$tag" )
53 75
54 echo ::: CLEANING UP REMOTE DIRECTORIES... :::
76 echo ::: PREPARING REMOTE DIRECTORIES... :::
55 77
56 78 ssh "$REMOTE_NAME" bash - << EOF ssh "$REMOTE_NAME" bash - << EOF
57 79 set -eu set -eu
 
... ... echo ::: COPYING EXECUTABLES TO THE REMOTE... :::
65 87 scp "$W32_DIR"/src/*.exe "$REMOTE_NAME:$REMOTE_WIN_DIR/w32/" scp "$W32_DIR"/src/*.exe "$REMOTE_NAME:$REMOTE_WIN_DIR/w32/"
66 88 scp "$W64_DIR"/src/*.exe "$REMOTE_NAME:$REMOTE_WIN_DIR/w64/" scp "$W64_DIR"/src/*.exe "$REMOTE_NAME:$REMOTE_WIN_DIR/w64/"
67 89
90 echo ::: BUILDING AND PACKAGING WINDOWS VERSION... :::
91
92 ssh "$REMOTE_NAME" bash - << EOF
93 set -eu
94
95 cd "$REMOTE_DIR/"
96 scripts/release "$version" archive
97 EOF
98
68 99 echo ::: PACKAGING SINGLE-EXECUTABLE VERSIONS... ::: echo ::: PACKAGING SINGLE-EXECUTABLE VERSIONS... :::
69 100
70 101 win="vifm-w32-$version-binary" win="vifm-w32-$version-binary"
 
... ... cp w64/*.exe "$w64"
91 122 zip -9 -r "$w64.zip" "$w64" zip -9 -r "$w64.zip" "$w64"
92 123 EOF EOF
93 124
94 echo ::: COPYING SINGLE-EXECUTABLE VERSIONS LOCALLY... :::
125 echo ::: COPYING WINDOWS VERSIONS LOCALLY... :::
95 126
96 scp "$REMOTE_NAME:$REMOTE_WIN_DIR/$w32.zip" \
127 scp "$REMOTE_NAME:$REMOTE_WIN_DIR/$win.zip" \
128 "$REMOTE_NAME:$REMOTE_WIN_DIR/$w32.zip" \
97 129 "$REMOTE_NAME:$REMOTE_WIN_DIR/$w64.zip" . "$REMOTE_NAME:$REMOTE_WIN_DIR/$w64.zip" .
98 chmod -x "$w32.zip" "$w64.zip"
130 chmod -x "$win.zip" "$w32.zip" "$w64.zip"
99 131
100 132 echo ::: VERIFYING PACKAGES... ::: echo ::: VERIFYING PACKAGES... :::
101 133
134 unzip "$win.zip"
102 135 unzip "$w32.zip" unzip "$w32.zip"
103 136 unzip "$w64.zip" unzip "$w64.zip"
104 137
 
... ... x64_exe='x86-64'
107 140
108 141 ret=0 ret=0
109 142
143 if [[ ! "$(file -b "$win/vifm.exe")" =~ "$x32_exe" ]]; then
144 echo "ERROR: Wrong type of $win/vifm.exe:"
145 file -b "$win/vifm.exe"
146 ret=1
147 fi
148 if [[ ! "$(file -b "$win/win_helper.exe")" =~ "$x32_exe" ]]; then
149 echo "ERROR: Wrong type of $win/win_helper.exe:"
150 file -b "$win/win_helper.exe"
151 ret=1
152 fi
110 153 if [[ ! "$(file -b "$w32/vifm.exe")" =~ "$x32_exe" ]]; then if [[ ! "$(file -b "$w32/vifm.exe")" =~ "$x32_exe" ]]; then
111 154 echo "ERROR: Wrong type of $w32/vifm.exe:" echo "ERROR: Wrong type of $w32/vifm.exe:"
112 155 file -b "$w32/vifm.exe" file -b "$w32/vifm.exe"
 
... ... if [[ ! "$(file -b "$w64/win_helper.exe")" =~ "$x64_exe" ]]; then
128 171 ret=1 ret=1
129 172 fi fi
130 173
131 rm -rf "$w32" "$w64"
174 rm -rf "$win" "$w32" "$w64"
132 175
133 176 if [ "$ret" -ne 0 ]; then if [ "$ret" -ne 0 ]; then
134 177 exit "$ret" exit "$ret"
135 178 fi fi
136 179
137 echo ::: COPYING TESTS... :::
180 echo ::: COPYING SE TESTS... :::
138 181
139 182 rm -r "$W32_DIR/tests/bin/build" "$W64_DIR/tests/bin/build" rm -r "$W32_DIR/tests/bin/build" "$W64_DIR/tests/bin/build"
140 183
 
... ... scp -r "$W32_DIR/tests/bin" "$W32_DIR/tests/test-data" \
143 186 scp -r "$W64_DIR/tests/bin" "$W64_DIR/tests/test-data" \ scp -r "$W64_DIR/tests/bin" "$W64_DIR/tests/test-data" \
144 187 "$REMOTE_NAME:$REMOTE_WIN_DIR/w64/" "$REMOTE_NAME:$REMOTE_WIN_DIR/w64/"
145 188
146 echo ::: RUNNING TESTS... :::
189 echo ::: RUNNING SE TESTS... :::
147 190
148 191 ssh "$REMOTE_NAME" bash - << EOF ssh "$REMOTE_NAME" bash - << EOF
149 192 set -eu set -eu
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master