-
Notifications
You must be signed in to change notification settings - Fork 107
130 lines (106 loc) · 3.15 KB
/
build.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: PyStand
on:
push:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
env:
BUILD_TYPE: Release
jobs:
build-msvc:
if: >-
github.event.pull_request.draft == false
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [ Win32, x64 ]
subsystem: [ GUI, CLI ]
include:
- generator: Visual Studio 17 2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: >
cmake
-G "${{ matrix.generator }}"
-A ${{ matrix.arch }}
-B build
${{ matrix.subsystem == 'GUI' && '-DPYSTAND_CONSOLE=OFF' || '-DPYSTAND_CONSOLE=ON' }}
- name: Build
run: |
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: PyStand-${{ matrix.arch }}-${{ matrix.subsystem }}
path: build/${{ env.BUILD_TYPE }}
build-gcc:
if: >-
github.event.pull_request.draft == false
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys: [ mingw32, mingw64 ]
subsystem: [ GUI, CLI ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup WinLibs
run: |
if ( '${{ matrix.sys }}' -eq 'mingw32' )
{
Invoke-WebRequest -Uri https://github.com/brechtsanders/winlibs_mingw/releases/download/7.5.0-7.0.0-r1/winlibs-i686-posix-dwarf-gcc-7.5.0-mingw-w64-7.0.0-r1.7z -OutFile ${{ matrix.sys }}.7z
}
else
{
Invoke-WebRequest -Uri https://github.com/brechtsanders/winlibs_mingw/releases/download/7.5.0-7.0.0-r1/winlibs-x86_64-posix-seh-gcc-7.5.0-mingw-w64-7.0.0-r1.7z -OutFile ${{ matrix.sys }}.7z
}
7z x ${{ matrix.sys }}.7z
"${{ github.workspace }}\${{ matrix.sys }}\bin" >> $env:GITHUB_PATH
- name: Configure
run: >
cmake
-G "MinGW Makefiles"
-B build
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
${{ matrix.subsystem == 'GUI' && '-DPYSTAND_CONSOLE=OFF' || '-DPYSTAND_CONSOLE=ON' }}
- name: Build
run: |
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: PyStand-${{ matrix.sys }}-${{ matrix.subsystem }}
path: build\PyStand.exe
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
needs: [ build-msvc, build-gcc ]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: List downloaded files
run: ls -R
- name: Create archives
run: >
7z
a
PyStand-v${{ github.ref_name }}-exe.zip
PyStand-Win32-CLI
PyStand-Win32-GUI
PyStand-x64-CLI
PyStand-x64-GUI
PyStand-mingw32-CLI
PyStand-mingw32-GUI
PyStand-mingw64-CLI
PyStand-mingw64-GUI
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
files: |
PyStand*.zip