From 27068bde8134e02fa79cdc4a6efbec114372fc76 Mon Sep 17 00:00:00 2001 From: Ronan LE MEILLAT Date: Sat, 23 Sep 2023 10:20:10 +0200 Subject: [PATCH] missing files --- .../workflows/multiarch-docker-hub-x86.yml | 49 +++++++++++++++++++ .gitignore | 1 + README.md | 23 ++++++--- test/src/simpletest.c | 10 ++++ 4 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/multiarch-docker-hub-x86.yml create mode 100644 .gitignore create mode 100644 test/src/simpletest.c diff --git a/.github/workflows/multiarch-docker-hub-x86.yml b/.github/workflows/multiarch-docker-hub-x86.yml new file mode 100644 index 0000000..bd357fc --- /dev/null +++ b/.github/workflows/multiarch-docker-hub-x86.yml @@ -0,0 +1,49 @@ +# Ce workflow utilise des actions qui ne sont pas certifiées par GitHub. +# Elles sont fournies par un tiers et régies par +# des conditions d’utilisation du service, une politique de confidentialité et un support distincts. +# documentation en ligne. + +# GitHub recommande d’épingler les actions à un SHA de commit. +# Pour obtenir une version plus récente, vous devez mettre à jour le SHA. +# Vous pouvez également référencer une balise ou une branche, mais l’action peut changer sans avertissement. + +name: Publish amd64/arm64 to docker Hub +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3.4.0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v5 + with: + platforms: 'arm64' + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.4.0 + with: + images: ${{ secrets.DOCKER_IMAGE_NAME }}-x86 + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64, linux/amd64 + push: true + build-args: | + MSVC_ARCH=x86 + LLVM_ARCH=i686 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/README.md b/README.md index 257894a..65f8e3b 100644 --- a/README.md +++ b/README.md @@ -14,17 +14,28 @@ With /usr/share/msvc/test/test.sh you can test a full compilation and executable test.sh contains: ```sh #!/bin/bash -$CC_x86_64_pc_windows_msvc $CL_FLAGS /I include /c src/test.c /Fotest.o -$CC_x86_64_pc_windows_msvc $CL_FLAGS /I include /c src/MainWindow.c /FoMainWindow.o -$CC_x86_64_pc_windows_msvc $CL_FLAGS /I include /c src/AboutDialog.c /FoAboutDialog.o +$CL /I include /c src/test.c +$CL /I include /c src/MainWindow.c +$CL /I include /c src/AboutDialog.c -$LINK_x86_64_pc_windows_msvc /libpath:$MSVC_BASE/sdk/lib/um/x86_64 /libpath:$MSVC_BASE/sdk/lib/ucrt/x86_64 /libpath:$MSVC_BASE/crt/lib/x86_64 \ - /subsystem:WINDOWS \ +$LINK /subsystem:WINDOWS \ user32.lib kernel32.lib comctl32.lib \ - test.o MainWindow.o AboutDialog.o \ + test.obj MainWindow.obj AboutDialog.obj \ /out:test.exe ``` +# Disclaimer +I build this for my own use, it corresponds to my need, if you need to adapt it to your needs feel free to fork and adapt… + +# Docker +## x86_64 (for arm64 and amd64 linux hosts) +``` +docker push highcanfly/llvm4msvc:latest +``` +## (work in progress) x86 (for arm64 and amd64 linux hosts) +``` +docker push highcanfly/llvm4msvc-x86:latest +``` # Shortcuts | | | diff --git a/test/src/simpletest.c b/test/src/simpletest.c new file mode 100644 index 0000000..2bfac43 --- /dev/null +++ b/test/src/simpletest.c @@ -0,0 +1,10 @@ +#include + +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, + LPSTR lpCmdLine, int nCmdShow) +{ + MessageBoxW(NULL, + L"Everything is working !", + L"Hello World", MB_OK); + return 0; +} \ No newline at end of file