Compare commits

..

17 Commits

Author SHA1 Message Date
OMGeeky
c950324cd9 Reorder NSIS installation step in release workflow 2025-02-16 01:10:25 +01:00
OMGeeky
b58d080f4d Update installer script and release workflow to improve version handling 2025-02-16 01:07:44 +01:00
OMGeeky
a2640c2da0 Update installer script and release workflow to use dynamic versioning 2025-02-16 00:57:27 +01:00
OMGeeky
4fe7e71a43 Refactor GitHub Actions workflow to streamline version retrieval process 2025-02-16 00:39:10 +01:00
OMGeeky
9a162ac58d Refactor release workflow to improve directory navigation and version handling 2025-02-16 00:36:02 +01:00
OMGeeky
93718230a5 Merge pull request #1 from OMGeeky/package-improvements
Package improvements
2025-02-16 00:27:35 +01:00
OMGeeky
4fbf7de85a Merge remote-tracking branch 'omgeeky/package-improvements' into package-improvements
# Conflicts:
#	packaging/Windows/ATCS_Installer.nsi
2025-02-16 00:26:03 +01:00
OMGeeky
f0be1a8135 Add GitHub Actions workflow for automated release builds 2025-02-16 00:24:50 +01:00
OMGeeky
104d3db5ad Update ATCS_Installer.nsi to change ATCS_SOURCE_DIR path for improved directory structure and allow github actions 2025-02-16 00:24:47 +01:00
OMGeeky
f154efcecc Update ATCS_Installer.nsi to dynamically set VERSION from ATCS_latest file 2025-02-16 00:24:05 +01:00
OMGeeky
00e9e3b2a7 Enhance package.sh to support platform-specific archive creation using PowerShell on Windows 2025-02-16 00:23:52 +01:00
OMGeeky
92436d3ce9 Update package.sh to switch from tar.gz to zip for archive creation 2025-02-16 00:23:52 +01:00
OMGeeky
b6cfe349c0 Add GitHub Actions workflow for automated release builds 2025-02-16 00:21:42 +01:00
OMGeeky
1e2daa56a4 Update ATCS_Installer.nsi to change ATCS_SOURCE_DIR path for improved directory structure and allow github actions 2025-02-16 00:21:05 +01:00
OMGeeky
2caaaeb474 Update ATCS_Installer.nsi to dynamically set VERSION from ATCS_latest file 2025-02-16 00:20:21 +01:00
OMGeeky
0e8ed1a25d Enhance package.sh to support platform-specific archive creation using PowerShell on Windows 2025-02-16 00:01:27 +01:00
OMGeeky
b5dceb9fd1 Update package.sh to switch from tar.gz to zip for archive creation 2025-02-15 23:32:36 +01:00
4 changed files with 102 additions and 47 deletions

68
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,68 @@
name: Release Build
on:
release:
types: [created]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Get Version
id: get_version
shell: bash
run: |
echo "Reading version from file:"
cat packaging/ATCS_latest
VERSION=$(cat packaging/ATCS_latest)
echo "Processed version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Environment variable set to: $VERSION"
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build JAR
shell: bash
run: |
cd packaging
chmod +x package.sh
echo "Building JAR and ZIP for version: ${{ env.VERSION }}"
./package.sh -windows
echo "Created artifacts:"
ls -la common/ATCS.jar
ls -la ATCS_${{ env.VERSION }}.zip
- name: Install NSIS
uses: joncloud/makensis-action@v4
env:
VERSION: ${{ env.VERSION }}
with:
script-file: packaging/Windows/ATCS_Installer.nsi
arguments: /DVERSION="${{ env.VERSION }}"
- name: Upload ZIP to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./packaging/ATCS_${{ env.VERSION }}.zip
asset_name: ATCS_${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: Upload Installer to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./packaging/ATCS_${{ env.VERSION }}_Setup.exe
asset_name: ATCS_${{ env.VERSION }}_Setup.exe
asset_content_type: application/octet-stream

View File

@@ -1,12 +1,12 @@
!include MUI2.nsh
!define VERSION "0.6.21"
; Version will be passed as /DVERSION=vx.x.x
!define TRAINER_VERSION "0.1.5"
!define JAVA_BIN "java"
!define ATCS_SOURCE_DIR "C:\ATCS"
!define ATCS_SOURCE_DIR "..\..\"
Name "Andor's Trail Content Studio v${VERSION}"
OutFile "ATCS_v${VERSION}_Setup.exe"
Name "Andor's Trail Content Studio ${VERSION}"
OutFile "..\ATCS_${VERSION}_Setup.exe"
InstallDir "$PROGRAMFILES\ATCS\"
;SetCompressor /SOLID /FINAL lzma
@@ -14,10 +14,10 @@ InstallDir "$PROGRAMFILES\ATCS\"
Var StartMenuFolder
!define MUI_WELCOMEPAGE_TITLE "Welcome to Andor's Trail Content Studio installer"
!define MUI_WELCOMEPAGE_TEXT "This will install Andor's Trail Content Studio v${VERSION}"
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio v${VERSION} - Install completed !"
!define MUI_WELCOMEPAGE_TEXT "This will install Andor's Trail Content Studio ${VERSION}"
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio ${VERSION} - Install completed !"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Andor's Trail Content Studio"
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio v${VERSION}"
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio ${VERSION}"
;Start Menu Folder Page Configuration
@@ -86,23 +86,23 @@ Section install
FileClose $9
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN "ATCS"
;--- Create shortcuts
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk" "$INSTDIR\ATCS.cmd" "" "$INSTDIR\ATCS.ico"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;------------------------------------------------------------------------------------
Section uninstall
Delete "$INSTDIR\lib\jide-oss.jar"
Delete "$INSTDIR\lib\ui.jar"
Delete "$INSTDIR\lib\junit-4.10.jar"
@@ -120,13 +120,13 @@ Section uninstall
Delete "$INSTDIR\ATCS.jar"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER "ATCS" $StartMenuFolder
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
SectionEnd
@@ -138,28 +138,28 @@ Function GetJRE
; 2 - in JAVA_HOME environment variable
; 3 - in the registry
; 4 - assume java.exe in current dir or PATH
Push $R0
Push $R1
;ClearErrors
;StrCpy $R0 "$EXEDIR\jre\bin\java.exe"
;IfFileExists $R0 JreFound
;StrCpy $R0 ""
ClearErrors
ReadEnvStr $R0 "JAVA_HOME"
StrCpy $R0 "$R0\bin\${JAVA_BIN}.exe"
IfErrors 0 JreFound
ClearErrors
ReadRegStr $R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R1" "JavaHome"
StrCpy $R0 "$R0\bin\${JAVA_BIN}.exe"
IfErrors 0 JreFound
StrCpy $R0 "${JAVA_BIN}.exe"
JreFound:
Pop $R1
Exch $R0

View File

@@ -21,7 +21,6 @@ MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt"
VERSION_FILE="${PACKAGING_DIR}/ATCS_latest"
SOURCE_BASE_DIR="${ATCS_SOURCE_DIR}/src" # Base directory for standard source code
LIB_BASE_DIR="${ATCS_SOURCE_DIR}/lib" # Base directory for libraries
OUTPUT_JAR_DIR="${PACKAGING_DIR}" # Directory where the final JAR will be placed - as per script
# --- **ADDITIONAL SOURCE CODE FOLDERS** ---
EXTRA_SOURCE_DIRS=(
@@ -103,17 +102,19 @@ cd "${PACKAGING_DIR}" || exit # Go back to packaging dir
echo ''
echo "Done creating jar at ${JAR_LOCATION}"
cp -f "${JAR_LOCATION}" "${OUTPUT_JAR_DIR}/common/ATCS.jar" # Copy JAR to versioned name
cp -f "${JAR_LOCATION}" "${PACKAGING_DIR}/common/ATCS.jar" # Copy JAR to versioned name
# --- Create archive ---
if [ "$PLATFORM" = "LINUX" ]; then
cd "${OUTPUT_JAR_DIR}" || exit
echo "Creating archive"
tar caf "ATCS_${VERSION}.tar.gz" common/* # archive the 'common' folder which now contains the JAR and libs
echo "Created archive at ${OUTPUT_JAR_DIR}/ATCS_${VERSION}.tar.gz"
cd "${PACKAGING_DIR}" || exit
cd "${PACKAGING_DIR}" || exit
echo "Creating archive"
if [ "$PLATFORM" = "WINDOWS" ]; then
# Use PowerShell's Compress-Archive which is available by default on Windows
powershell.exe -Command "Compress-Archive -Path './common/*' -DestinationPath './ATCS_${VERSION}.zip' -Force"
else
echo "Can't create zip files on windows yet. Please pack the content of the '${OUTPUT_JAR_DIR}/common/' folder yourself"
# Use zip command on Linux
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
fi
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
cd "${PACKAGING_DIR}" || exit
echo "Script finished."

View File

@@ -153,7 +153,8 @@ public class ATContentStudio {
while ((inputLine = in.readLine()) != null) {
lastLine = inputLine;
}
if (lastLine != null && compareVersions(lastLine) < 0) {
if (lastLine != null && !lastLine.equals(APP_VERSION)) {
// for copying style
JLabel label = new JLabel();
Font font = label.getFont();
@@ -230,19 +231,4 @@ public class ATContentStudio {
}
}
}
/// returns The difference between the the latest version and the current one (CURRENT - LATEST)
private static int compareVersions(String latest) {
String[] levels1 = ATContentStudio.APP_VERSION.substring(1).split("\\.");
String[] levels2 = latest.substring(1).split("\\.");
int length = Math.max(levels1.length, levels2.length);
for (int i = 0; i < length; i++) {
int v1 = i < levels1.length ? Integer.parseInt(levels1[i]) : 0;
int v2 = i < levels2.length ? Integer.parseInt(levels2[i]) : 0;
if (v1 != v2) {
return v1 - v2;
}
}
return 0;
}
}