-
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 3.88 KB
/
MSYS_MINGW64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: msys_mingw64
on:
pull_request:
branches: [ "main", "development" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# Using some intentionally obscure vars to avoid false positives
CMAKE_CONFIGURATION_TYPES: Debug;Release;RelWithDebInfo;MinSizeRel
CMAKE_BUILD_TYPE: Release
# SOURCE_DIR: "D:/a/CxxWin/Cxxwin"
# MSYS_INSTALL_PATH: "D:/a/_temp/msys64"
# MSYS_TYPE: MINGW64
# MSYS_T_LOWER: mingw64
# MSYS_DIR: "D:/a/_temp/msys64/mingw64"
# BINARY_DIR: "D:/a/CxxWin/Cxxwin/out/mingw64"
jobs:
msys-mingw64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
# - name: Cache Restore
# id: cache-restore-pacman-mingw64
# uses: actions/cache/restore@v3
# with:
# # A directory to store and save the cache
# path: "C:/hostedtoolcache/windows"
# # An explicit key for restoring and saving the cache
# key: ${{ runner.os }}-pacman-mingw64
# # An ordered list of keys to use for restoring the cache if no cache hit occurred for key
# # restore-keys: # optional
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-make
# - name: Cache Save
# id: cache-save-pacman-mingw64
# uses: actions/cache/save@v3
# with:
# # A directory to store and save the cache
# path: "C:/hostedtoolcache/windows"
# # $(cygpath -u "${{github.workspace}}\out\mingw64")
# # An explicit key for restoring and saving the cache
# key: ${{ steps.cache-restore-pacman-mingw64.outputs.cache-primary-key }}
# # An ordered list of keys to use for restoring the cache if no cache hit occurred for key
# # restore-keys: # optional
- name: Prepare Env
working-directory: ${{ env.SOURCE_DIR }}
run: source ./msystem.sh
- name: Configure
working-directory: ${{ env.SOURCE_DIR }}
# Configure CMake in a 'bin' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: /mingw64/bin/cmake.exe -S . "-DCMAKE_CXX_COMPILER:FILEPATH=D:/a/_temp/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe" "-DCMAKE_C_COMPILER:FILEPATH=D:/a/_temp/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe" "-DCMAKE_RC_COMPILER:FILEPATH=D:/a/_temp/msys64/mingw64/bin/windres.exe" "-DCMAKE_LINKER:FILEPATH=D:/a/_temp/msys64/mingw64/bin/ld.exe" "-DCMAKE_MAKE_PROGRAM:FILEPATH=D:/a/_temp/msys64/mingw64/bin/mingw32-make.exe" "-DCMAKE_INSTALL_PREFIX:FILEPATH=${CMAKE_BINARY_DIR}/install" "-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE" -B ./out/mingw64 -G "MinGW Makefiles"
- name: Build
working-directory: ${{ env.SOURCE_DIR }}
# Build your program with the given configuration
run: /mingw64/bin/cmake.exe --build ./out/mingw64
# - name: Test
# working-directory: ${{github.workspace}}/build/x64-windows
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}
- name: Package Source
working-directory: ${{ env.SOURCE_DIR }}
# Build your program with the given configuration
run: /mingw64/bin/cpack.exe --config ./out/mingw64/CPackSourceConfig.cmake
- name: Zip
working-directory: ${{ env.SOURCE_DIR }}
run: /mingw64/bin/cpack.exe -G ZIP --config ./out/mingw64/CPackSourceConfig.cmake
- name: Tar
working-directory: ${{ env.SOURCE_DIR }}
run: /mingw64/bin/cpack.exe -G TGZ --config ./out/mingw64/CPackSourceConfig.cmake