-
Notifications
You must be signed in to change notification settings - Fork 2
171 lines (153 loc) · 4.86 KB
/
macos.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
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
name: Nightly build MacOS
on:
push:
tags:
- 'Nightly'
jobs:
set-revision:
name: set revision
runs-on: ubuntu-20.04
outputs:
output1: ${{ steps.out1.outputs.revision }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: detect revision
run: |
read text < ./src/simutrans/revision.h
revision=${text:17:5}
echo "revision=$revision" >> $GITHUB_ENV
- id: out1
run: echo "revision=$revision" >> $GITHUB_OUTPUT
sim-mac-sdl2:
name: macOS (SDL2)
runs-on: macos-12
needs: [set-revision]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Dependencies
run: |
brew reinstall cmake pkg-config libpng freetype zstd sdl2 fluidsynth
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cp ../revision.h ./revision.h
cmake --build . --target install
- name: Build Zip
run: |
cd build
zip -r simumac_x86-nightly.zip simutrans
- name: Upload Artifact (CI)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/simumac_x86-nightly.zip
asset_name: simumac_x86-nightly_r${{ needs.set-revision.outputs.output1 }}.zip
#name: ${{ github.job }}-nightly
#path:
tag: Nightly
overwrite: true
sim-mac-arm:
name: macOS (ARM)
runs-on: macos-latest
needs: [set-revision]
steps:
- uses: actions/checkout@v4
- name: install_dependencies
run: |
brew reinstall cmake pkg-config libpng freetype zstd sdl2 fluidsynth
- name: build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cp ../revision.h ./revision.h
cmake --build . --target install
- name: distribute
run: |
cd build
zip -r simumac-arm-nightly.zip simutrans
- name: Update binaries of Nightly Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/simumac-arm-nightly.zip
asset_name: simumac-arm-nightly_r${{ needs.set-revision.outputs.output1 }}.zip
tag: Nightly
overwrite: true
makeobj-mac_x86:
name: macOS Makeobj
runs-on: macos-12
needs: [set-revision]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cp configs/config.makeobj-mac config.default
- name: Build
run: make -j2 makeobj
- name: zip result
run: zip -r -9 makeobj_macos-nightly.zip build/default/makeobj/makeobj
- name: Upload Artifact (CI)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: makeobj_macos-nightly.zip
asset_name: makeobj_macos-x86-nightly_r${{ needs.set-revision.outputs.output1 }}.zip
#name: ${{ github.job }}-nightly
#path: build/default/makeobj/makeobj
tag: Nightly
overwrite: true
makeobj-mac_arm:
name: makeobj macOS arm
runs-on: macos-latest
needs: [set-revision]
steps:
- uses: actions/checkout@v4
- name: install_dependencies
run: |
brew reinstall cmake pkg-config libpng
- name: build
run: |
printf "#define REVISION %i\n" $(tools/get_revision.sh) > src/simutrans/revision.h
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cp ./revision.h ./build/revision.h
cmake --build build/src/makeobj
- name: distribute
run: |
cd build/src/makeobj
zip -r makeobj-arm-nightly.zip makeobj
- name: Update binaries of Nightly Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/src/makeobj/makeobj-arm-nightly.zip
asset_name: makeobj_macos-arm-nightly_r${{ needs.set-revision.outputs.output1 }}.zip
tag: Nightly
overwrite: true
nettool-mac:
name: macOS Nettool
runs-on: macos-12
needs: [set-revision]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cp configs/config.${{ github.job }} config.default
- name: Build
run: make -j2 nettool
- name: zip result
run: zip -r -9 nettool_mac-nightly.zip build/default/nettool/nettool
- name: Upload Artifact (CI)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: nettool_mac-nightly.zip
asset_name: nettool_mac-x86-nightly_r${{ needs.set-revision.outputs.output1 }}.zip
#name: ${{ github.job }}-nightly
#path: build/default/nettool/nettool
tag: Nightly
overwrite: true