Compare commits

..

4 Commits

5 changed files with 46 additions and 35 deletions

View File

@@ -16,8 +16,8 @@ jobs:
shell: bash
run: |
echo "Reading version from file:"
cat res/ATCS_latest
VERSION=$(cat res/ATCS_latest)
cat packaging/ATCS_latest
VERSION=$(cat packaging/ATCS_latest | sed 's/^v//' | sed 's/[^0-9.]//g')
echo "Processed version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Environment variable set to: $VERSION"
@@ -26,7 +26,10 @@ jobs:
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
distribution: 'adopt'
- name: Install NSIS
uses: joncloud/makensis-action@v4
- name: Build JAR
shell: bash
@@ -36,22 +39,35 @@ jobs:
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
ls -la common/ATCS.jar
- 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: Create Installer
shell: bash
run: |
cd packaging/Windows
ls -la
echo "Building installer for version: ${{ env.VERSION }}"
makensis /DVERSION="${{ env.VERSION }}" ATCS_Installer.nsi
echo "Created installer:"
ls -la ATCS_v${{ env.VERSION }}_Setup.exe
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
- name: Upload ZIP to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
./packaging/ATCS_${{ env.VERSION }}.zip
./packaging/ATCS_${{ env.VERSION }}_Setup.exe
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/Windows/ATCS_v${{ env.VERSION }}_Setup.exe
asset_name: ATCS_v${{ env.VERSION }}_Setup.exe
asset_content_type: application/octet-stream

View File

@@ -1,12 +1,12 @@
!include MUI2.nsh
; Version will be passed as /DVERSION=vx.x.x
; Version will be passed as /DVERSION=x.x.x
!define TRAINER_VERSION "0.1.5"
!define JAVA_BIN "java"
!define ATCS_SOURCE_DIR "..\..\"
Name "Andor's Trail Content Studio ${VERSION}"
OutFile "..\ATCS_${VERSION}_Setup.exe"
Name "Andor's Trail Content Studio v${VERSION}"
OutFile "ATCS_v${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 ${VERSION}"
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio ${VERSION} - Install completed !"
!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_STARTMENUPAGE_DEFAULTFOLDER "Andor's Trail Content Studio"
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio ${VERSION}"
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio v${VERSION}"
;Start Menu Folder Page Configuration

View File

@@ -18,7 +18,7 @@ ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
TEMP_DIR="${PACKAGING_DIR}/tmp"
JAR_LOCATION="${PACKAGING_DIR}/ATCS.jar" # Output JAR location as per script
MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt"
VERSION_FILE="${ATCS_SOURCE_DIR}/res/ATCS_latest"
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
@@ -84,7 +84,6 @@ mkdir -p "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img"
mkdir -p "${TEMP_DIR}/tiled/io/resources/"
cp -r "${ATCS_SOURCE_DIR}"/src/com/gpl/rpg/atcontentstudio/img/* "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img/" # some icons
cp -r "${ATCS_SOURCE_DIR}"/hacked-libtiled/tiled/io/resources/* "${TEMP_DIR}/tiled/io/resources/" # dtd file for tmx maps
cp "${VERSION_FILE}" "${TEMP_DIR}/" # Copy version file
# --- Create JAR file ---
echo ""

View File

@@ -14,7 +14,11 @@ import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -38,7 +42,8 @@ import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
public class ATContentStudio {
public static final String APP_NAME = "Andor's Trail Content Studio";
public static final String APP_VERSION = readVersionFromFile();
public static final String APP_VERSION = "v0.6.21";
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
@@ -226,13 +231,4 @@ public static final String APP_VERSION = readVersionFromFile();
}
}
}
private static String readVersionFromFile() {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
Objects.requireNonNull(ATContentStudio.class.getResourceAsStream("/ATCS_latest"))))) {
return reader.readLine();
} catch (IOException e) {
e.printStackTrace();
return "unknown";
}
}
}