Skip to content

Commit 7b77381

Browse files
Update package.sh
1 parent 4ca26be commit 7b77381

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

Scripts/package.sh

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -96,41 +96,43 @@ for TARGET in "${SRMM_BUILD_DIRS[@]}"; do
9696

9797
done
9898

99-
for TARGET in "${UPDATER_BUILD_DIRS[@]}"; do
100-
DIR="${UPDATER_SELECTOR}/${TARGET}"
101-
OUTPUT_TARGET_STR=$(echo "${TARGET}" | sed -e "s/\b\(.\)/\u\1/g") # Capitalizes each target word: linux-slim -> Linux-Slim
102-
OUTPUT_FILE_BASE="${UPDATER_BASE_NAME}-${OUTPUT_TARGET_STR}-Latest"
103-
104-
echo "Compressing ${OUTPUT_FILE_BASE}..."
105-
106-
7za a "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.zip" -tzip -bd -y "${DIR}/*" > /dev/null
107-
tar czf "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.tar.gz" --owner=0 --group=0 --numeric-owner -C "${DIR}/" .
108-
109-
cp -r "${UPDATER_OUTPUT_DIR}/." $GITHUB_WORKSPACE/AppcastRepo/updater/
110-
111-
### Create Appcast
112-
113-
# Really hate how this is done, but I can't think of anything better
114-
if [[ "${OUTPUT_FILE_BASE}" =~ -Linux- ]]; then
115-
OS_NAME="linux"
116-
EXEC_NAME="${UPDATER_BASE_NAME}"
117-
elif [[ "${OUTPUT_FILE_BASE}" =~ -Windows- ]]; then
118-
OS_NAME="windows"
119-
EXEC_NAME="${UPDATER_BASE_NAME}.exe"
120-
fi
99+
if [ "$IS_PREVIEW" = false ]; then
100+
for TARGET in "${UPDATER_BUILD_DIRS[@]}"; do
101+
DIR="${UPDATER_SELECTOR}/${TARGET}"
102+
OUTPUT_TARGET_STR=$(echo "${TARGET}" | sed -e "s/\b\(.\)/\u\1/g") # Capitalizes each target word: linux-slim -> Linux-Slim
103+
OUTPUT_FILE_BASE="${UPDATER_BASE_NAME}-${OUTPUT_TARGET_STR}-Latest"
104+
105+
echo "Compressing ${OUTPUT_FILE_BASE}..."
121106

122-
# Create only for .zip, as that's universally available
123-
netsparkle-generate-appcast \
124-
-a "${APPCAST_OUTPUT_DIR}" \
125-
--single-file "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.zip" \
126-
-o "${OS_NAME}" \
127-
-n "${EXEC_NAME}" \
128-
--output-file-name "appcast_ryuupdater-${TARGET}" \
129-
--use-ed25519-signature-attribute \
130-
--human-readable \
131-
--file-version "${UPDATER_VERSION}" \
132-
-u "${UPDATER_URL_BASE}" > /dev/null
133-
done
107+
7za a "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.zip" -tzip -bd -y "${DIR}/*" > /dev/null
108+
tar czf "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.tar.gz" --owner=0 --group=0 --numeric-owner -C "${DIR}/" .
109+
110+
cp -r "${UPDATER_OUTPUT_DIR}/." $GITHUB_WORKSPACE/AppcastRepo/updater/
111+
112+
### Create Appcast
113+
114+
# Really hate how this is done, but I can't think of anything better
115+
if [[ "${OUTPUT_FILE_BASE}" =~ -Linux- ]]; then
116+
OS_NAME="linux"
117+
EXEC_NAME="${UPDATER_BASE_NAME}"
118+
elif [[ "${OUTPUT_FILE_BASE}" =~ -Windows- ]]; then
119+
OS_NAME="windows"
120+
EXEC_NAME="${UPDATER_BASE_NAME}.exe"
121+
fi
122+
123+
# Create only for .zip, as that's universally available
124+
netsparkle-generate-appcast \
125+
-a "${APPCAST_OUTPUT_DIR}" \
126+
--single-file "${UPDATER_OUTPUT_DIR}/${OUTPUT_FILE_BASE}.zip" \
127+
-o "${OS_NAME}" \
128+
-n "${EXEC_NAME}" \
129+
--output-file-name "appcast_ryuupdater-${TARGET}" \
130+
--use-ed25519-signature-attribute \
131+
--human-readable \
132+
--file-version "${UPDATER_VERSION}" \
133+
-u "${UPDATER_URL_BASE}" > /dev/null
134+
done
135+
fi
134136

135137
### Copy AppCasts to repo
136138

0 commit comments

Comments
 (0)