seperate linux windows build

This commit is contained in:
2025-08-04 20:11:25 +02:00
parent a08e3142b0
commit 5a87336d98
2 changed files with 34 additions and 7 deletions

View File

@@ -149,7 +149,7 @@ jobs:
echo "Windows binary:"
ls -la windows-bin/
- name: Build using Docker Buildx
- name: Linux build using Docker Buildx
run: |
docker buildx create --use
docker buildx build \
@@ -173,13 +173,40 @@ jobs:
docker tag ${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}
echo "Pushing Linux Docker image to registry: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}"
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}
windows-docker-build:
name: Build Windows Docker Image
needs: [windows-cross]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build Windows Docker image
- name: Download Windows artifact
uses: actions/download-artifact@v3
with:
name: windows-binary
path: windows-bin
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Windows build using Docker Buildx
run: |
docker buildx create --use
docker buildx build \
--platform windows/amd64 \
-f Dockerfile.windows \
--build-arg BINARY_NAME=${{ needs.detect-project.outputs.project-name }} \
--load \
-t ${{ env.IMAGE_NAME }}:windows-${{ env.TAG }} .
- name: Tag and Push Windows Docker image
if: ${{ success() }}
run: |
echo "Building Windows Docker-Image with env-Tag: ${{env.TAG }}"
docker build -f Dockerfile.windows -t ${{ env.IMAGE_NAME }}:windows-${{ env.TAG }} .
echo docker login ${{ env.REGISTRY }} -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo "Tagging Windows Docker image"
docker tag ${{ env.IMAGE_NAME }}:windows-${{ env.TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:windows-${{ env.TAG }}
echo "Pushing Windows Docker image to registry: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:windows-${{ env.TAG }}"