-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (87 loc) · 2.76 KB
/
windows-mingw.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
90
91
92
93
94
95
96
97
name: Windows MinGW
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows MinGW 32",
os: windows-latest,
artifact: "windows_mingw_32.7z",
build_type: "Release",
sys: mingw32,
env: i686,
cc: "i686-w64-mingw32-gcc",
cxx: "i686-w64-mingw32-g++",
archiver: "7z a",
generators: "Ninja"
}
- {
name: "Windows MinGW 64",
os: windows-latest,
artifact: "windows_mingw_64.7z",
build_type: "Release",
sys: mingw64,
env: x86_64,
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
archiver: "7z a",
generators: "Ninja"
}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
update: false
msystem: ${{ matrix.config.sys }}
install: mingw-w64-${{ matrix.config.env }}-gcc cmake ninja
- name: Configure
shell: msys2 {0}
run: |
mkdir build
mkdir instdir
cmake \
-S . \
-B . \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER="${{ matrix.config.cc }}" \
-DCMAKE_CXX_COMPILER="${{ matrix.config.cxx }}" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
- name: Build
shell: msys2 {0}
run: cmake --build . --config ${{ matrix.config.build_type }}
- name: Install Strip
shell: msys2 {0}
run: cmake --install . --strip
- name: Pack
shell: bash
working-directory: instdir
run: |
ls -laR
${{ matrix.config.archiver }} ../${{ matrix.config.artifact }} .
- name: Upload
uses: actions/upload-artifact@v3
with:
path: ./${{ matrix.config.artifact }}
name: ${{ matrix.config.artifact }}
- name: Upload release asset
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.config.artifact }}
asset_name: ${{ matrix.config.artifact }}
asset_content_type: application/x-7z-compressed