-
Notifications
You must be signed in to change notification settings - Fork 195
132 lines (128 loc) · 4.54 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
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
cxx: [g++, clang++]
steps:
- uses: actions/checkout@v4
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install opengl
run: sudo apt-get -o Acquire::Retries=3 install mesa-common-dev libgl1-mesa-dev libgl1-mesa-glx
- name: install gtk
run: sudo apt-get -o Acquire::Retries=3 install libgtk-3-dev
- name: cmake
run: CXX=${{ matrix.cxx }} cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=TreeSheets-relocatable -DTREESHEETS_RELOCATABLE_INSTALLATION=ON
- name: build TreeSheets
run: cmake --build _build -j4
- name: install files
run: cmake --install _build
- name: zip
run: zip -r linux_treesheets_${{ matrix.cxx }}.zip TreeSheets-relocatable
- name: upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: Linux TreeSheets ${{ matrix.cxx }}
path: TreeSheets-relocatable
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "linux_treesheets_${{ matrix.cxx }}.zip"
build-windows:
name: Build Windows
runs-on: windows-2022
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: clone wxWidgets
run: |
git clone --depth 1 --recurse-submodules https://github.com/wxWidgets/wxWidgets
(gc 'wxWidgets\build\msw\wx_setup.props') -replace '<wxReleaseRuntimeLibrary>MultiThreadedDLL</wxReleaseRuntimeLibrary>', '<wxReleaseRuntimeLibrary>MultiThreaded</wxReleaseRuntimeLibrary>' | Out-File -encoding ASCII 'wxWidgets\build\msw\wx_setup.props'
- name: build wxWidgets
working-directory: wxWidgets
run: msbuild.exe build/msw/wx_vc14.sln /p:Configuration=Release /p:Platform=x64 /p:RuntimeLibrary=MultiThreaded
- name: build TreeSheets
run: |
msbuild.exe win\treesheets.sln /p:Configuration=Release /p:Platform=x64
Remove-Item TS\*.pdb
Remove-Item TS\*.ipdb
Remove-Item TS\*.iobj
Compress-Archive -Path TS -DestinationPath windows_treesheets_no_installer.zip
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Windows TreeSheets (no installer)
path: TS
- name: Create installer
uses: joncloud/makensis-action@v4
with:
script-file: "win/TS_installer.nsi"
arguments: "/V3"
- name: upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: Windows TreeSheets (installer)
path: "win/windows_treesheets_setup.exe"
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "win/windows_treesheets_setup.exe,windows_treesheets_no_installer.zip"
build-mac:
name: Build Mac
runs-on: macos-latest
env:
minmac: 10.15
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Prepare Plist
run: |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(date +'%Y%m%d%H%M%S')" osx/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $(date +'%Y.%m.%d')" osx/Info.plist
/usr/libexec/PlistBuddy -c "Set :LSMinimumSystemVersion $minmac" osx/Info.plist
- name: cmake
run: cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="$minmac" -DCMAKE_INSTALL_PREFIX=macos-bundle
- name: Build TreeSheets
run: cmake --build _build -j4
- name: Create bundle
run: cmake --install _build
- name: Zip bundle
run: zip -r ../mac_treesheets.zip TreeSheets.app
working-directory: macos-bundle
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "mac_treesheets.zip"