ci: add Windows

This commit is contained in:
李通洲
2022-10-10 18:12:04 +08:00
parent 9bc5c99fc8
commit 2cb7be67bd
+65
View File
@@ -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