-
Notifications
You must be signed in to change notification settings - Fork 193
144 lines (140 loc) · 5.19 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
133
134
135
136
137
138
139
140
141
142
143
144
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 TreeSheets\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: "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: 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: "windows_treesheets_setup.exe,windows_treesheets_no_installer.zip"
build-mac:
name: Build Mac
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: clone wxWidgets
run: git clone --depth 1 --recurse-submodules https://github.com/wxWidgets/wxWidgets
- name: build wxWidgets
run: |
mkdir -p wxWidgets/build_
cd wxWidgets/build_
../configure --disable-shared --disable-sys-libs --with-osx_cocoa --without-libtiff --enable-universal_binary=x86_64,arm64 CXXFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++" OBJCXXFLAGS="-stdlib=libc++" CC=clang CXX=clang++
make -j4
- name: install wxWidgets
run: |
cd wxWidgets/build_
sudo make install
- name: build TreeSheets
working-directory: osx/TreeSheets
run: |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(date +'%Y%m%d%H%M%S')" "TreeSheets/TreeSheets-Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $(date +'%Y.%m.%d')" "TreeSheets/TreeSheets-Info.plist"
xcodebuild -list
xcodebuild -toolchain clang -configuration Release -target TreeSheets -scheme TreeSheets -derivedDataPath build
chmod +x build/Build/Products/Release/TreeSheets.app/Contents/MacOS/TreeSheets
rm -rf build/Build/Products/Release/TreeSheets.app.dSYM
zip -r ../../mac_treesheets.zip build/Build/Products/Release
- name: upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: Mac TreeSheets
path: build/Build/Products/Release
- 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"