-
Notifications
You must be signed in to change notification settings - Fork 16
94 lines (89 loc) · 2.82 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
name: Build all Platforms
on:
push:
pull_request:
branches: [ main ]
workflow_dispatch: # Can also be called manually for whatever reason, e.g. if wanting to build with FMOD sound
inputs:
flags:
description: "Flags to be passed to CMake"
required: false
type: string
default: '-DINCLUDE_FMOD_SOUND=1'
# Let's set all project specific definitions globally
env:
PRJ_NAME: XPMP2
jobs:
#####################################
# Linux with GCC
build-lin:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4 # must checkout before we can use our own actions
- name: Build
uses: ./.github/actions/build-lin
id: build
with:
libName: ${{ env.PRJ_NAME }}
flags: ${{ inputs.flags }}
- name: Prepare XPMP2 lib
shell: bash
run: |
mkdir -p deploy-lib/lib/lin
cp -a ./inc deploy-lib
mv ${{ steps.build.outputs.lib-file-name }} deploy-lib/lib/lin
- name: Upload XPMP2 lib
uses: actions/upload-artifact@v4
with:
name: XPMP2-lib-lin
path: deploy-lib/* # this way we keep the folder structure in the artifact
if-no-files-found: error
#####################################
# MacOS with CMake/clang and sign/notarize in self-written script
build-mac:
runs-on: macos-11
steps:
- name: Checkout Code
uses: actions/checkout@v4 # must checkout before we can use our own actions
- name: Build
uses: ./.github/actions/build-mac
id: build
with:
libName: ${{ env.PRJ_NAME }}
flags: ${{ inputs.flags }}
- name: Prepare XPMP2 Framework
shell: bash
run: |
mkdir -p deploy-lib/lib
mv ${{ steps.build.outputs.lib-file-name }} deploy-lib/lib
- name: Upload XPMP2 Framework
uses: actions/upload-artifact@v4
with:
name: XPMP2-lib-mac
path: deploy-lib/* # this way we keep the folder structure in the artifact
if-no-files-found: error
#####################################
# Windows with MS Visual Studio
build-win:
runs-on: windows-2022
steps:
- name: Checkout Code
uses: actions/checkout@v4 # must checkout before we can use our own actions
- name: Build
uses: ./.github/actions/build-win
id: build
with:
libName: ${{ env.PRJ_NAME }}
flags: ${{ inputs.flags }}
- name: Prepare XPMP2 lib
shell: bash
run: |
mkdir -p deploy-lib/lib/win
cp ${{ steps.build.outputs.lib-file-name }} deploy-lib/lib/win
- name: Upload XPMP2 lib
uses: actions/upload-artifact@v4
with:
name: XPMP2-lib-win
path: deploy-lib/* # this way we keep the folder structure in the artifact
if-no-files-found: error