Compare commits

..

11 Commits

Author SHA1 Message Date
OMGeeky
f8d9fdf717 Update release workflow to use Temurin distribution for Java setup 2025-02-16 02:04:36 +01:00
OMGeeky
caefca8885 Update package.sh to copy version file from VERSION_FILE variable
(cherry picked from commit 5ff45746d8)
2025-02-16 01:58:43 +01:00
OMGeeky
1e0ee2ca1d Update release workflow to read version from the correct file path 2025-02-16 01:46:20 +01:00
OMGeeky
1663cd713c Refactor release workflow to consolidate asset uploads
(cherry picked from commit becf45f249)
2025-02-16 01:44:39 +01:00
OMGeeky
814341a4d8 Reorder NSIS installation step in release workflow
(cherry picked from commit c950324cd9)
2025-02-16 01:44:38 +01:00
OMGeeky
889a81c501 Update installer script and release workflow to improve version handling
(cherry picked from commit b58d080f4d)
2025-02-16 01:44:38 +01:00
OMGeeky
ccc56f0d3a Update installer script and release workflow to use dynamic versioning
(cherry picked from commit a2640c2da0)
2025-02-16 01:44:38 +01:00
OMGeeky
a5492b16ac Refactor GitHub Actions workflow to streamline version retrieval process
(cherry picked from commit 4fe7e71a43)
2025-02-16 01:44:38 +01:00
OMGeeky
6686aa6c07 Refactor release workflow to improve directory navigation and version handling
(cherry picked from commit 9a162ac58d)
2025-02-16 01:44:38 +01:00
OMGeeky
4390b730b4 Refactor version handling to read APP_VERSION from ATCS_latest file 2025-02-16 01:44:23 +01:00
OMGeeky
ab8fd034e5 Update package.sh to reference ATCS_latest from the source directory and copy it to the temporary packaging directory 2025-02-16 01:44:14 +01:00
4 changed files with 26 additions and 32 deletions

View File

@@ -16,8 +16,8 @@ jobs:
shell: bash
run: |
echo "Reading version from file:"
cat packaging/ATCS_latest
VERSION=$(cat packaging/ATCS_latest)
cat res/ATCS_latest
VERSION=$(cat res/ATCS_latest)
echo "Processed version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Environment variable set to: $VERSION"
@@ -26,15 +26,7 @@ jobs:
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Install NSIS
uses: joncloud/makensis-action@v4
env:
VERSION: ${{ env.VERSION }}
with:
script-file: packaging/Windows/ATCS_Installer.nsi
arguments: /DVERSION="${{ env.VERSION }}"
distribution: 'temurin'
- name: Build JAR
shell: bash
@@ -47,22 +39,19 @@ jobs:
ls -la common/ATCS.jar
ls -la ATCS_${{ env.VERSION }}.zip
- name: Upload ZIP to Release
uses: actions/upload-release-asset@v1
- name: Install NSIS
uses: joncloud/makensis-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
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
script-file: packaging/Windows/ATCS_Installer.nsi
arguments: /DVERSION="${{ env.VERSION }}"
- name: Upload Installer to Release
uses: actions/upload-release-asset@v1
- name: Upload Release Assets
uses: softprops/action-gh-release@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
files: |
./packaging/ATCS_${{ env.VERSION }}.zip
./packaging/ATCS_${{ env.VERSION }}_Setup.exe

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="${PACKAGING_DIR}/ATCS_latest"
VERSION_FILE="${ATCS_SOURCE_DIR}/res/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,6 +84,7 @@ 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,11 +14,7 @@ import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -42,8 +38,7 @@ 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 = "v0.6.21";
public static final String APP_VERSION = readVersionFromFile();
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";
@@ -231,4 +226,13 @@ public class ATContentStudio {
}
}
}
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";
}
}
}