diff --git a/.github/workflows/job_build_tr2.yml b/.github/workflows/job_build_tr2.yml index b83a2006d..71679cd01 100644 --- a/.github/workflows/job_build_tr2.yml +++ b/.github/workflows/job_build_tr2.yml @@ -1,4 +1,4 @@ -name: Build TR2X +name: Build TR2X and the installer on: workflow_call: @@ -19,6 +19,8 @@ jobs: just_target: tr2-package-linux ${{ inputs.target }} - platform: win just_target: tr2-package-win-all ${{ inputs.target }} + - platform: win-installer + just_target: tr2-package-win-installer ${{ inputs.target }} steps: - name: Install dependencies diff --git a/justfile b/justfile index 20f2a5bf8..42fd71978 100644 --- a/justfile +++ b/justfile @@ -65,6 +65,7 @@ tr1-package-win-installer target='release': (tr1-build-win target) (tr1-build-wi tr2-image-linux force="1": (_docker_build "tools/tr2/docker/game-linux/Dockerfile" "rrdash/tr2x-linux" force) tr2-image-win force="1": (_docker_build "tools/tr2/docker/game-win/Dockerfile" "rrdash/tr2x" force) tr2-image-win-config force="1": (_docker_build "tools/tr2/docker/config/Dockerfile" "rrdash/tr2x-config" force) +tr2-image-win-installer force="1": (_docker_build "tools/tr2/docker/installer/Dockerfile" "rrdash/tr2x-installer" force) tr2-push-image-linux: (tr2-image-linux "0") (_docker_push "rrdash/tr2x-linux") tr2-push-image-win: (tr2-image-win "0") (_docker_push "rrdash/tr2x") @@ -72,10 +73,17 @@ tr2-push-image-win: (tr2-image-win "0") (_docker_push "rrdash/ tr2-build-linux target='debug': (tr2-image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x-linux") tr2-build-win target='debug': (tr2-image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x") tr2-build-win-config: (tr2-image-win-config "0") (_docker_run "rrdash/tr2x-config") +tr2-build-win-installer: (tr2-image-win-installer "0") (_docker_run "rrdash/tr2x-installer") tr2-package-linux target='release': (tr2-build-linux target) (_docker_run "rrdash/tr2x-linux" "package") tr2-package-win target='release': (tr2-build-win target) (_docker_run "rrdash/tr2x" "package") tr2-package-win-all target='release': (tr2-build-win target) (tr2-build-win-config) (_docker_run "rrdash/tr2x" "package") +tr2-package-win-installer target='release': (tr2-build-win target) (tr2-build-win-config) (_docker_run "rrdash/tr2x" "package" "-o" "tools/installer/TR2X_Installer/Resources/release.zip") (tr2-build-win-installer) + #!/bin/sh + git checkout "tools/installer/TR2X_Installer/Resources/release.zip" + exe_name=TR2X-$(tools/get_version 1)-Installer.exe + cp tools/installer/out/TR2X_Installer.exe "${exe_name}" + echo "Created ${exe_name}" output-release-name tr_version: tools/output_release_name {{tr_version}} diff --git a/tools/tr2/docker/installer/Dockerfile b/tools/tr2/docker/installer/Dockerfile new file mode 100644 index 000000000..3f61c77f7 --- /dev/null +++ b/tools/tr2/docker/installer/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env + +ENV HOME /app +WORKDIR /app +ENTRYPOINT ["/app/tools/tr2/docker/installer/entrypoint.sh"] diff --git a/tools/tr2/docker/installer/entrypoint.sh b/tools/tr2/docker/installer/entrypoint.sh new file mode 100755 index 000000000..bc8362382 --- /dev/null +++ b/tools/tr2/docker/installer/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -x +set -e + +cd /app/tools/installer/ + +export DOTNET_CLI_HOME="/tmp/DOTNET_CLI_HOME" + +shopt -s globstar +rm -rf **/bin **/obj **/out/* +dotnet restore +dotnet publish TR2X_Installer -c Release -o out