Correct CI, NSIS
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Dmitry Isaenko 2025-11-22 23:56:51 +03:00
parent 5533eeb640
commit 5f3a87a356
6 changed files with 33 additions and 47 deletions

View file

@ -1,27 +0,0 @@
steps:
- name: build
image: maven:3-openjdk-17
commands:
- mvn -B -DskipTests clean install
- mvn test -B
volumes:
- /home/docker/woodpecker/files/m2:/root/.m2
- name: archive-artifacts
image: alpine:latest
commands:
- mkdir -p /builds/Tihwin
- cp target/Tihwin-*[0-9].jar /builds/Tihwin/
- cp target/Tihwin-*[0-9].exe /builds/Tihwin/
volumes:
- /home/www/builds:/builds
- name: make-win-installer
image: wheatstalk/makensis:3
commands:
- cp target/Tihwin-*.exe NSIS/Tihwin.exe
- NSIS/update_version.sh
- cd NSIS
- makensis -V4 ./installer.nsi
- cp Installer-*.exe /builds/Tihwin/
volumes:
- /home/www/builds:/builds
- /home/docker/woodpecker/files/assembly/openjdk-19.0.2:/assembly/jdk

View file

@ -1,33 +1,41 @@
steps: steps:
- name: build - name: build
when: when:
event: [ tag, push ] event: [ tag, push, manual]
image: maven:3-openjdk-17 image: maven:3-openjdk-17
commands: commands:
- mvn -B -DskipTests clean install - mvn -B -DskipTests clean package
- mvn test -B - mvn test -B
- mkdir artifacts
- cp target/Tihwin-*[0-9].jar artifacts
- cp target/Tihwin-*[0-9].exe artifacts
volumes: volumes:
- /home/docker/woodpecker/files/m2:/root/.m2 - /home/docker/woodpecker/files/m2:/root/.m2
- name: archive-artifacts
when:
event: [ tag, push ]
image: alpine:latest
commands:
- mkdir -p /builds/Tihwin
- cp target/Tihwin-*[0-9].jar /builds/Tihwin/
- cp target/Tihwin-*[0-9].exe /builds/Tihwin/
volumes:
- /home/www/builds:/builds
- name: make-win-installer - name: make-win-installer
when: when:
event: [ tag, push ] event: [ tag, push, manual]
image: wheatstalk/makensis:3 image: wheatstalk/makensis:3
commands: commands:
- cp target/Tihwin-*.exe NSIS/Tihwin.exe - cp target/Tihwin-*.exe NSIS/Tihwin.exe
- NSIS/update_version.sh - NSIS/update_version.sh
- cd NSIS - cd NSIS
- makensis -V4 ./installer.nsi - makensis -V4 ./installer.nsi
- cp Installer-*.exe /builds/Tihwin/ - echo Installer-*.exe
- cp Installer-*.exe "../artifacts"
- cd ..
volumes: volumes:
- /home/www/builds:/builds - /home/www/builds:/builds
- /home/docker/woodpecker/files/assembly/openjdk-19.0.2:/assembly/jdk - /home/docker/woodpecker/files/assembly/openjdk-19.0.2:/assembly/jdk
- name: save-artifacts
when:
event: [ tag, push ]
image: alpine:latest
commands:
- export ARTIFACTS_DIR="$(date -d @$CI_PIPELINE_CREATED +'%Y-%m-%d %H:%m %Z')"
- echo $ARTIFACTS_DIR
- mkdir -p /builds/Tihwin/
- mv artifacts "/builds/Tihwin/$ARTIFACTS_DIR"
volumes:
- /home/www/builds:/builds

View file

@ -70,11 +70,16 @@
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Indonesian"
;Language strings ;Language strings
LangString l10n_CreateShortcut ${LANG_ENGLISH} "Create Desktop Shortcut" LangString l10n_CreateShortcut ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString l10n_CreateShortcut ${LANG_RUSSIAN} "Создать ярлык на Рабочем столе" LangString l10n_CreateShortcut ${LANG_RUSSIAN} "Создать ярлык на Рабочем столе"
LangString l10n_CreateShortcut ${LANG_JAPANESE} "デスクトップにショートカットを作成する"
LangString l10n_CreateShortcut ${LANG_SPANISHINTERNATIONAL} "Crear un acceso directo en el escritorio"
BrandingText "Tihwin"
;-------------------------------- ;--------------------------------
Section "Tihwin" Install Section "Tihwin" Install

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
TIMESTAMP=`date +%Y%m%d.%H%M%S`
VERSIONMAJOR=`grep '<version>' pom.xml | head -1 | sed -e 's/^.*<version>//g' -e 's/\..*$//g'` VERSIONMAJOR=`grep '<version>' pom.xml | head -1 | sed -e 's/^.*<version>//g' -e 's/\..*$//g'`
VERSIONMINOR=`grep '<version>' pom.xml | head -1 | sed -E 's/^.*<version>[0-9]+?\.//g' | sed -E -e 's/(\..*|-SNAPSHOT|)<\/version>.*$//g'` VERSIONMINOR=`grep '<version>' pom.xml | head -1 | sed -E 's/^.*<version>[0-9]+?\.//g' | sed -E -e 's/(\..*|-SNAPSHOT|)<\/version>.*$//g'`
sed -z -i -e "s/!define\ VERSIONMAJOR\ [0-9]/!define\ VERSIONMAJOR $VERSIONMAJOR\ /" NSIS/installer.nsi sed -z -i -e "s/!define\ VERSIONMAJOR\ [0-9]/!define\ VERSIONMAJOR $VERSIONMAJOR\ /" NSIS/installer.nsi
sed -z -i -e "s/!define\ VERSIONMINOR\ [0-9]/!define\ VERSIONMINOR $VERSIONMINOR\ /" NSIS/installer.nsi sed -z -i -e "s/!define\ VERSIONMINOR\ [0-9]/!define\ VERSIONMINOR $VERSIONMINOR\ /" NSIS/installer.nsi
sed -z -i -e "s/OutFile\ \"Installer.exe\"/OutFile\ \"Installer-$VERSIONMAJOR.$VERSIONMINOR-$TIMESTAMP.exe\"\ /" NSIS/installer.nsi sed -z -i -e "s/OutFile\ \"Installer.exe\"/OutFile\ \"Installer-$VERSIONMAJOR.$VERSIONMINOR.exe\"\ /" NSIS/installer.nsi
sed -z -i -e "s/BrandingText\ \"Tihwin\"/BrandingText\ \"Tihwin v$VERSIONMAJOR.$VERSIONMINOR\"\ /" NSIS/installer.nsi

View file

@ -62,7 +62,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName> <finalName>${project.artifactId}-${project.version}</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
@ -134,8 +134,8 @@
<configuration> <configuration>
<headerType>gui</headerType> <headerType>gui</headerType>
<icon>tw_icon.ico</icon> <icon>tw_icon.ico</icon>
<outfile>target/${project.name}-${project.version}-${maven.build.timestamp}.exe</outfile> <outfile>target/${project.name}-${project.version}.exe</outfile>
<jar>target/${project.artifactId}-${project.version}-${maven.build.timestamp}.jar</jar> <jar>target/${project.artifactId}-${project.version}.jar</jar>
<errTitle>${project.name} launching error</errTitle> <errTitle>${project.name} launching error</errTitle>
<classPath> <classPath>
<mainClass>tihwin.Main</mainClass> <mainClass>tihwin.Main</mainClass>