1
1
name : Build
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
7
- paths-ignore : [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
8
- pull_request :
9
- branches :
10
- - main
11
- paths-ignore : [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
4
+ workflow_call :
5
+ inputs :
6
+ os :
7
+ default : windows-2019
8
+ type : string
9
+ architecture :
10
+ description : ' Build Architecture'
11
+ default : x86
12
+ type : string
13
+ upload :
14
+ description : Upload resulting artifact?
15
+ type : boolean
16
+ default : false
17
+
18
+ run-name : Build ${{ inputs.architecture }} on ${{ inputs.os }}
19
+
20
+ permissions :
21
+ contents : read
12
22
13
23
jobs :
14
24
build :
15
25
name : Build
26
+ runs-on : ${{ inputs.os }}
16
27
17
28
env :
18
29
DXSDK_DIR : " ${{ github.workspace }}\\ DXSDK"
19
30
20
- strategy :
21
- fail-fast : false
22
- matrix :
23
- architecture : [x64, x86]
24
- os : [windows-2019, windows-2022]
25
-
26
- runs-on : ${{ matrix.os }}
27
-
28
31
steps :
29
32
- name : Checkout
30
33
uses : actions/checkout@v4
37
40
- name : Setup MSVC Console
38
41
uses : ilammy/msvc-dev-cmd@v1
39
42
with :
40
- arch : ${{ matrix .architecture }}
43
+ arch : ${{ inputs .architecture }}
41
44
42
45
- name : Create directories
43
46
run : |
47
50
- name : Cache irrKlang package
48
51
uses : actions/cache@v4
49
52
with :
50
- path : ${{ github.workspace }}/Extern/irrKlang/${{ matrix .architecture }}
51
- key : irrKlang-${{ matrix .architecture }}
53
+ path : ${{ github.workspace }}/Extern/irrKlang/${{ inputs .architecture }}
54
+ key : irrKlang-${{ inputs .architecture }}
52
55
53
56
- name : Cache DirectX SDK
54
57
id : cache
@@ -68,16 +71,16 @@ jobs:
68
71
dir /S /B DXSDK
69
72
70
73
- name : Configure
71
- run : cmake . --preset windows-${{ matrix .architecture }}-release -DORBITER_MAKE_DOC=OFF -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"
74
+ run : cmake . --preset windows-${{ inputs .architecture }}-release -DORBITER_MAKE_DOC=OFF -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"
72
75
73
76
- name : Build
74
- run : cmake --build --preset windows-${{ matrix .architecture }}-release --jobs 2
77
+ run : cmake --build --preset windows-${{ inputs .architecture }}-release --jobs 2
75
78
76
79
- name : Test
77
- run : ctest --preset windows-${{ matrix .architecture }}-release --jobs 2
80
+ run : ctest --preset windows-${{ inputs .architecture }}-release --parallel 2
78
81
79
82
- name : Install
80
- working-directory : ${{ github.workspace }}/out/build/windows-${{ matrix .architecture }}-release
83
+ working-directory : ${{ github.workspace }}/out/build/windows-${{ inputs .architecture }}-release
81
84
run : cmake --install . --prefix ${{ github.workspace }}/out/install
82
85
83
86
- name : List exports
@@ -91,71 +94,30 @@ jobs:
91
94
del /Q exports_tmp*.txt
92
95
93
96
- name : Diff exports with Orbiter 2016
94
- if : ${{ matrix .architecture == 'x86' }}
97
+ if : ${{ inputs .architecture == 'x86' }}
95
98
shell : cmd
96
99
continue-on-error : true
97
100
run : git diff -U0 --ignore-cr-at-eol --ignore-space-at-eol --no-index exports.2016.txt out/install/Orbiter/exports.txt
98
101
99
- - name : Upload exports
100
- if : ${{ matrix.os == 'windows-2019' }}
101
- uses : actions/upload-artifact@v4
102
- with :
103
- name : exports-${{ matrix.architecture }}
104
- path : ${{ github.workspace }}/out/install/Orbiter/exports.txt
105
- retention-days : 1
106
-
107
102
- name : Pack
108
103
if : ${{ github.ref == 'refs/heads/main' }}
109
104
working-directory : ${{ github.workspace }}/out/install/Orbiter
110
105
shell : cmd
111
106
run : ' 7z a "${{ github.workspace }}/out/Orbiter.zip" .'
112
107
108
+ - name : Upload exports
109
+ if : inputs.upload
110
+ uses : actions/upload-artifact@v4
111
+ with :
112
+ name : exports-${{ inputs.architecture }}
113
+ path : ${{ github.workspace }}/out/install/Orbiter/exports.txt
114
+ retention-days : 1
115
+
113
116
- name : Upload Build Artifact
114
- if : ${{ github.ref == 'refs/heads/main' && matrix.os == 'windows-2019' }}
115
117
uses : actions/upload-artifact@v4
118
+ if : inputs.upload
116
119
with :
117
- name : Orbiter-${{ matrix .architecture }}
120
+ name : Orbiter-${{ inputs .architecture }}
118
121
# A file, directory or wildcard pattern that describes what to upload
119
122
path : ${{ github.workspace }}/out/Orbiter.zip
120
- retention-days : 60
121
-
122
- pre-release :
123
- name : Publish pre-release
124
-
125
- needs : build
126
-
127
- runs-on : ubuntu-latest
128
-
129
- if : ${{ github.ref == 'refs/heads/main' }}
130
-
131
- steps :
132
- - name : Create directories
133
- run : mkdir out
134
-
135
- - name : Checkout
136
- uses : actions/checkout@v4
137
-
138
- - name : Download artifacts
139
- uses : actions/download-artifact@v4
140
- with :
141
- path : ./out
142
-
143
- - name : Re-arrange artifacts
144
- run : |
145
- mv ./Orbiter-x64/Orbiter.zip ./Orbiter-x64.zip
146
- mv ./Orbiter-x86/Orbiter.zip ./Orbiter-x86.zip
147
- rmdir Orbiter-x64
148
- rmdir Orbiter-x86
149
- ls -R
150
- working-directory : ./out
151
-
152
- - name : " Push pre-release tag and upload packages"
153
- uses : " marvinpinto/action-automatic-releases@latest"
154
- with :
155
- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
156
- automatic_release_tag : " latest"
157
- prerelease : true
158
- title : " Orbiter development build"
159
- files : |
160
- ./out/Orbiter-x86.zip
161
- ./out/Orbiter-x64.zip
123
+ retention-days : 1
0 commit comments