cleanup some packaging stuff

This commit is contained in:
OMGeeky
2025-02-18 18:08:02 +01:00
parent becf45f249
commit ed2ad56b76
2 changed files with 12 additions and 8 deletions

View File

@@ -17,7 +17,8 @@ jobs:
run: | run: |
echo "Reading version from file:" echo "Reading version from file:"
cat packaging/ATCS_latest cat packaging/ATCS_latest
VERSION=$(cat packaging/ATCS_latest) echo ""
VERSION=$(tr -d '[:space:]' < "packaging/ATCS_latest")
echo "Processed version: $VERSION" echo "Processed version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Environment variable set to: $VERSION" echo "Environment variable set to: $VERSION"
@@ -26,7 +27,7 @@ jobs:
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
java-version: '11' java-version: '11'
distribution: 'adopt' distribution: 'temurin'
- name: Build JAR - name: Build JAR
shell: bash shell: bash
@@ -41,8 +42,6 @@ jobs:
- name: Install NSIS - name: Install NSIS
uses: joncloud/makensis-action@v4 uses: joncloud/makensis-action@v4
env:
VERSION: ${{ env.VERSION }}
with: with:
script-file: packaging/Windows/ATCS_Installer.nsi script-file: packaging/Windows/ATCS_Installer.nsi
arguments: /DVERSION="${{ env.VERSION }}" arguments: /DVERSION="${{ env.VERSION }}"

View File

@@ -29,7 +29,7 @@ EXTRA_SOURCE_DIRS=(
"siphash-zackehh/src/main/java" "siphash-zackehh/src/main/java"
) )
# --- Libraries to include (from IntelliJ artifact definition) --- # --- Libraries to include ---
LIBRARIES=( LIBRARIES=(
"AndorsTrainer_v0.1.5.jar" "AndorsTrainer_v0.1.5.jar"
"bsh-2.0b4.jar" "bsh-2.0b4.jar"
@@ -44,7 +44,7 @@ LIBRARIES=(
# --- Get version --- # --- Get version ---
echo "Getting version" echo "Getting version"
VERSION=$(cat "${VERSION_FILE}") VERSION=$(tr -d '[:space:]' < "${VERSION_FILE}")
echo "Got version ${VERSION}" echo "Got version ${VERSION}"
# --- Prepare temporary directory --- # --- Prepare temporary directory ---
@@ -62,7 +62,7 @@ done
# --- Set ClassPath --- # --- Set ClassPath ---
echo "Getting source files" echo "Getting source files"
# Find all java files in source directories and compile them # Find all java files in source directories
SOURCE_FILES=$(find "${SOURCE_BASE_DIR}" "${EXTRA_SOURCE_DIRS[@]/#/${ATCS_SOURCE_DIR}/}" -name "*.java" -print) SOURCE_FILES=$(find "${SOURCE_BASE_DIR}" "${EXTRA_SOURCE_DIRS[@]/#/${ATCS_SOURCE_DIR}/}" -name "*.java" -print)
#echo "SourceFiles: ${SOURCE_FILES}" #echo "SourceFiles: ${SOURCE_FILES}"
echo "" echo ""
@@ -70,6 +70,8 @@ echo ""
# --- Build Java classes --- # --- Build Java classes ---
echo 'Building java classes' echo 'Building java classes'
# shellcheck disable=SC2086
# (we need word splitting here to pass multiple files)
javac -cp "${TEMP_DIR}" -d "${TEMP_DIR}" ${SOURCE_FILES} javac -cp "${TEMP_DIR}" -d "${TEMP_DIR}" ${SOURCE_FILES}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Compilation failed. Please check errors above." echo "Compilation failed. Please check errors above."
@@ -114,7 +116,10 @@ else
# Use zip command on Linux # Use zip command on Linux
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
fi fi
if [ $? -ne 0 ]; then
echo "Archive creation failed."
exit 1
fi
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip" echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
cd "${PACKAGING_DIR}" || exit
echo "Script finished." echo "Script finished."