forked from The-Powder-Toy/The-Powder-Toy
-
Notifications
You must be signed in to change notification settings - Fork 5
220 lines (218 loc) · 9.95 KB
/
build.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: build
on:
push:
branches:
- 'main'
tags:
- 'v*.*'
- 'snapshot-*'
pull_request:
branches:
- '*'
jobs:
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
can_publish: ${{ steps.starcatcher_check.outputs.can_publish }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: get_type
run: python3 ./.github/get-type.py ${{ github.ref }}
- id: create_release
if: steps.get_type.outputs.TYPE != 'dev'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.get_type.outputs.NAME }}
draft: true
prerelease: false
- id: starcatcher_check
if: steps.get_type.outputs.TYPE != 'dev'
run: bash -c './.github/starcatcher-check.sh'
env:
STARCATCHER_PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
build:
runs-on: ${{ matrix.os }}
needs: [release]
strategy:
matrix:
# | lin-x86_64 | mac-x86_64 | win-x86_64 | lin-i686 | mac-i686 | win-i686 | lin-arm64 | mac-arm64 | win-arm64
# --------------+------------+------------+------------+------------+------------+------------+------------+------------+------------
# gcc-static | | | NO | NO | NO | NO | NO | | NO
# msvc-static | NO | NO | | NO | NO | | NO | NO | NO
# mingw-static | | NO | | NO | NO | NO | NO | NO | NO
# gcc-dynamic | | | NO | NO | NO | NO | NO | NO [1] | NO
# msvc-dynamic | NO | NO | | NO | NO | | NO | NO | NO
# mingw-dynamic | | NO | | NO | NO | NO | NO | NO | NO
#
# [1] This is only required for development on ARM Macs. We have no access to such devices, so someone will
# have to help us figure out how to get dynamic libraries.
#
# Please keep this matrix in sync with the other one in this file, see the ### blocks.
# The only difference should be that the second matrix has all mingw cells disabled; we don't publish mingw builds on starcatcher.
#########################################################
############# BEGIN BLOCK FOR COPYING BELOW #############
#########################################################
platform_short: [lin, mac, win]
toolset_short: [gcc, msvc, mingw]
machine_short: [x86_64, i686, arm64]
static_dynamic: [static, dynamic]
exclude:
- toolset_short: mingw
machine_short: i686 # remove this line after copying the matrix below
- toolset_short: mingw # remove this line after copying the matrix below
platform_short: mac # remove this line after copying the matrix below
- machine_short: i686
platform_short: lin
- machine_short: i686
platform_short: mac
- toolset_short: msvc
platform_short: lin
- toolset_short: msvc
platform_short: mac
- toolset_short: gcc
platform_short: win
- platform_short: lin
machine_short: arm64
- platform_short: win
machine_short: arm64
- platform_short: mac # see [1]
static_dynamic: dynamic
machine_short: arm64
#########################################################
############## END BLOCK FOR COPYING BELOW ##############
#########################################################
include:
- platform_short: lin
os: ubuntu-18.04
suffix: ''
- platform_short: mac
os: macos-11.0
suffix: ''
- platform_short: win
os: windows-2019
suffix: '.exe'
- platform_short: lin
toolset_short: mingw
os: ubuntu-20.04
suffix: '.exe'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: get_type
run: python3 ./.github/get-type.py ${{ github.ref }}
- if: matrix.platform_short == 'lin' && matrix.toolset_short == 'mingw'
run: sudo apt update && sudo apt install g++-mingw-w64-x86-64
- if: matrix.platform_short == 'mac'
uses: Homebrew/actions/setup-homebrew@master
- if: matrix.platform_short == 'mac'
run: brew install pkg-config
- if: matrix.platform_short == 'mac' && matrix.static_dynamic != 'static'
run: brew install luajit curl fftw zlib sdl2
- if: matrix.platform_short == 'lin' && matrix.static_dynamic != 'static'
run: sudo apt update && sudo apt install libluajit-5.1-dev libcurl4-openssl-dev libfftw3-dev zlib1g-dev libsdl2-dev
- run: python3 -m pip install meson ninja
- run: bash -c './.github/build.sh'
env:
PLATFORM_SHORT: ${{ matrix.platform_short }}
MACHINE_SHORT: ${{ matrix.machine_short }}
TOOLSET_SHORT: ${{ matrix.toolset_short }}
STATIC_DYNAMIC: ${{ matrix.static_dynamic }}
RELNAME: ${{ steps.get_type.outputs.NAME }}
RELTYPE: ${{ steps.get_type.outputs.TYPE }}
MOD_ID: ${{ steps.get_type.outputs.MOD_ID }}
- uses: actions/upload-release-asset@v1
if: steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: powder${{ matrix.suffix }}
asset_name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
asset_content_type: application/zip
- uses: actions/upload-artifact@v2
if: matrix.static_dynamic == 'static'
with:
path: powder${{ matrix.suffix }}
name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
starcatcher-publish:
runs-on: ubuntu-latest
needs: [build, release]
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
strategy:
matrix:
#########################################################
############# BEGIN BLOCK COPIED FROM ABOVE #############
#########################################################
platform_short: [lin, mac, win]
toolset_short: [gcc, msvc, mingw]
machine_short: [x86_64, i686, arm64]
static_dynamic: [static, dynamic]
exclude:
- toolset_short: mingw
- machine_short: i686
platform_short: lin
- machine_short: i686
platform_short: mac
- toolset_short: msvc
platform_short: lin
- toolset_short: msvc
platform_short: mac
- toolset_short: gcc
platform_short: win
- platform_short: lin
machine_short: arm64
- platform_short: win
machine_short: arm64
- platform_short: mac # see [1]
static_dynamic: dynamic
machine_short: arm64
#########################################################
############## END BLOCK COPIED FROM ABOVE ##############
#########################################################
- static_dynamic: dynamic
include:
- platform_short: lin
suffix: ''
- platform_short: mac
suffix: ''
- platform_short: win
suffix: '.exe'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: get_type
run: python3 ./.github/get-type.py ${{ github.ref }}
- uses: actions/download-artifact@v1
with:
name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
- run: sudo apt update && sudo apt install lftp
- if: steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
run: bash -c './.github/starcatcher-publish.sh powder${{ matrix.suffix }}'
env:
STARCATCHER_PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
STARCATCHER_PUBLISH_USERNAME: ${{ secrets.STARCATCHER_PUBLISH_USERNAME }}
STARCATCHER_PUBLISH_PASSWORD: ${{ secrets.STARCATCHER_PUBLISH_PASSWORD }}
STARCATCHER_PUBLISH_FILENAME: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
starcatcher-release:
runs-on: ubuntu-latest
needs: [starcatcher-publish, release]
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- id: get_type
run: python3 ./.github/get-type.py ${{ github.ref }}
- run: ./.github/starcatcher-release.sh "https://starcatcher.us/TPT/perform-release.lua?mod=${{ steps.get_type.outputs.MOD_ID }}&type=${{ steps.get_type.outputs.TYPE }}&name=${{ steps.get_type.outputs.NAME }}&commit=${{ github.sha }}"