-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (52 loc) · 1.71 KB
/
windows.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
name: "Windows build"
on:
push:
pull_request:
jobs:
build-windows:
name: ${{ matrix.toolset }}-${{ matrix.arch }} on ${{ matrix.msvs }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: [Win32, x64]
toolset: [v143]
msvs: ['Visual Studio 17 2022']
vs-versions: ['[17.0,17.30)']
os: [windows-2022]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: ${{ matrix.vs-versions }}
- name: Configure
run: |
mkdir build
cd build
cmake -G "${{ matrix.msvs }}" -T ${{ matrix.toolset }} -A ${{ matrix.arch }} ..
- name: Build
run: |
cd build
cmake --build . --config RelWithDebInfo -- /verbosity:d
- name: Artifact
uses: actions/upload-artifact@v4
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
name: Windows SDK
path: |
build/FreeOrionSDK_*_MSVC-${{ matrix.toolset }}-${{ matrix.arch }}.zip
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/v')
id: prepare-release-options
run: |
echo "release-name=$(git tag -ln --format '%(subject)' ${{ github.ref_name }})" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@v1
name: Release
if: startsWith(github.ref, 'refs/tags/v')
with:
name: ${{ steps.prepare-release-options.outputs.release-name }}
draft: true
files: |
build/FreeOrionSDK_*_MSVC-${{ matrix.toolset }}-${{ matrix.arch }}.zip
token: ${{ secrets.RELEASE_TOKEN }}