From 2cb7be67bd714b713ac62109a6e60ea16db6f7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 10 Oct 2022 18:12:04 +0800 Subject: [PATCH] ci: add Windows --- .github/workflows/push.yml | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ae492a408..6b532c563 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -123,6 +123,71 @@ jobs: name: fastfetch-bsd path: ./fastfetch-*.* + windows: + name: Windows + runs-on: windows-latest + permissions: + security-events: write + contents: read + outputs: + ffversion: ${{ steps.ffversion.outputs.ffversion }} + defaults: + run: + shell: msys2 {0} + steps: + - name: checkout repository + uses: actions/checkout@v3 + + - name: setup-msys2 + uses: msys2/setup-msys2@v2 + with: + msystem: MSYS + update: true + install: git base-devel cmake gcc mingw-w64-clang-x86_64-cjson mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-opencl-icd + + - name: print msys version + run: uname -a + + # https://github.com/msys2/MINGW-packages/issues/13524#event-7555720785 + - name: create OpenCL.pc + run: | + cat > /clang64/lib/pkgconfig/OpenCL.pc << EOF + prefix=/clang64 + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: OpenCL + Description: Open Computing Language generic Installable Client Driver Loader + Version: 2022.09.30-1 + Libs: -L${libdir} -lOpenCL.dll + Cflags: -I${includedir} + EOF + + - name: configure project + run: env PKG_CONFIG_PATH=/clang64/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . + + - name: build project + run: cmake --build . --target fastfetch --target flashfetch # Makes no sense to install exes to /usr/bin for Windows + + - name: copy necessary dlls + run: cp /usr/bin/msys-2.0.dll /clang64/bin/*.dll . + + # Crashes on start for some reason, but it provides binaries at least. Needs investigation. + # - name: run fastfetch + # run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all + + # - name: run flashfetch + # run: ./flashfetch + + - name: upload artifacts + uses: actions/upload-artifact@v3 + with: + name: fastfetch-windows + path: | + ./*.dll + ./*.exe + release: if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'LinusDierheimer/fastfetch' name: Release