Skip to content

Commit

Permalink
build executable from github action and pass it to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega committed Jan 19, 2024
1 parent 3c4b64d commit cd305a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ jobs:
install_runtime: true
cache: true
destination: ${{ github.workspace }}/vulkan-sdt

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- name: Publish with dotnet
run: |
dotnet publish -c Release -r win10-x64 -o ./publish --self-contained true
- name: Build Docker image
run: docker build -t lods --build-arg VULKAN_DLL_PATH=./vulkan-sdt/1.3.268.0/runtime/x64/vulkan-1.dll .
run: docker build -t lods --build-arg EXECUTABLE=./DCL_PiXYZ.exe --build-arg VULKAN_DLL_PATH=./vulkan-sdt/1.3.268.0/runtime/x64/vulkan-1.dll .

- name: Execute test case | tmp
run: |
Expand Down
26 changes: 4 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,11 @@ RUN powershell -Command \

RUN setx /M PATH "%PATH%;C:\Node\node-v18.0.0-win-x64"

# RUN powershell -Command Invoke-WebRequest -OutFile dotnet-runtime-installer.exe -Uri https://download.visualstudio.microsoft.com/download/pr/6744eb9d-dcd4-4386-9d87-b03b70fc58ce/818fadf3f3d919c17ba845b2195bfd9b/dotnet-hosting-3.1.32-win.exe; \
# Start-Process -Wait -FilePath .\dotnet-runtime-installer.exe -ArgumentList '/install /quiet'; \
# Remove-Item dotnet-runtime-installer.exe -Force

# ENV PATH="C:\Program Files\dotnet:${PATH}"

WORKDIR /app/api
COPY --from=dotnet-build /app/api/publish/ .
COPY build-lods.ps1 .
# RUN regsvr32 /s "C:\app\api\PiXYZAPI.dll"

RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe && \
start /wait vs_buildtools.exe --quiet --wait --norestart --nocache \
--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --quiet --norestart \
--installPath C:\BuildTools && \
del vs_buildtools.exe

RUN FOR /R "C:\BuildTools\VC\Tools\MSVC" %i IN (dumpbin.exe) DO setx /M PATH "%~dpi;%PATH%"

RUN dumpbin /dependents ./PiXYZAPI.dll

# Set environment variables for Visual Studio
# ENV PATH="C:\BuildTools\Common7\Tools\;C:\BuildTools\VC\Tools\MSVC\14.29.16\bin\Hostx64\x64;${PATH}"
# COPY --from=dotnet-build /app/api/publish/ .
# COPY build-lods.ps1 .
ARG EXECUTABLE
COPY ${EXECUTABLE} ./DCL_PiXYZ.exe

RUN dir

Expand Down

0 comments on commit cd305a8

Please sign in to comment.