-
Notifications
You must be signed in to change notification settings - Fork 37
237 lines (205 loc) · 7.3 KB
/
main.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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Tinyphone Build
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
tinyphone_win_job:
name: Build Tinyphone Windows
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '1'
submodules: 'recursive'
- name: Disable IPv6
shell: bash -l {0}
run: echo "DISABLE_IPV6=1" >> $GITHUB_ENV
- name: Restore Boost Cache
uses: actions/cache@v3
id: cache-boost
with:
path: C:\local\boost_1_74_0
key: boost-74
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
# Use the boost_1_74_0-msvc-14.1-64.exe for Windows 2019
$Url = "https://onboardcloud.dl.sourceforge.net/project/boost/boost-binaries/1.74.0/boost_1_74_0-msvc-14.2-32.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=C:\local\boost_1_74_0"
- name: Install Scoop & Binaries
run : |
[Net.ServicePointManager]::SecurityProtocol =[Net.SecurityProtocolType]::Tls12 ;
(New-Object System.Net.WebClient).DownloadFile('https://get.scoop.sh', "install_scoop.ps1");
.\install_scoop.ps1 -RunAsAdmin
scoop install curl wget cmake unzip make;
- name: Install wixtoolset
run : |
$Url = "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\wix311.exe")
Start-Process -Wait -FilePath "$env:TEMP\wix311.exe" "/install","/quiet","/norestart"
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Configure build for Windows MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Build Project
run : |
$env:CodeDir=$(pwd)
.\distribution\docker\release.ps1 -ErrorAction Stop
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: tinyphone.msi
path: |
./tinyphone-installer/bin/Release/tinyphone_installer.msi
- name: Create Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
artifacts: "./tinyphone/Release/tinyphone.exe,tinyphone-installer/bin/Release/tinyphone_installer.msi"
draft: true
allowUpdates: true
token: ${{ secrets.GH_TOKEN }}
tinyphone_osx_job:
name: Build Tinyphone macOS
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '1'
submodules: 'recursive'
- name: Disable IPv6
shell: bash -l {0}
run: echo "DISABLE_IPV6=1" >> $GITHUB_ENV
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
#BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
#echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
#print signing keys
security find-identity -v
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
#cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install Dependencies
shell: bash
run : |
export HOMEBREW_NO_INSTALL_CLEANUP=true
brew install autoconf automake libtool tree wget opencore-amr
wget https://gist.githubusercontent.com/kingster/1954ead3c38a40cac88c5c1311bb39c5/raw/343da2c7a2a52ee5a1c03902cc5e44ed83b1dd5d/cryptopp.rb
brew install --build-from-source -f cryptopp.rb
npm install -g appdmg
- name: Compile Libraries
run : |
#xcode needs to be proper at this point
xcode-select --print-path
#boost
pushd tinyphone-osx/vendor/boost
./boost.sh -macos --boost-version 1.74.0
popd
#stastd
pushd lib/statsd-cpp
mkdir build-osx
cd build-osx
cmake ..
make
popd
- name: Build Project
run : |
pushd tinyphone-osx
pod install
security find-identity -v -p codesigning
xcodebuild -workspace Tinyphone.xcworkspace -scheme Tinyphone -configuration Release CODE_SIGN_IDENTITY="Apple Development" CODE_SIGNING_REQUIRED=YES
./package.sh
# Don't sign dmg with developer certificate, throws nasty warning.
# codesign --force --sign "Apple Development" tinyphone.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: tinyphone.dmg
path: |
./tinyphone-osx/tinyphone.dmg
- name: Create Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
artifacts: "./tinyphone-osx/tinyphone.dmg"
draft: true
allowUpdates: true
token: ${{ secrets.GH_TOKEN }}
tinyphone_linux_job:
name: Build Tinyphone Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '1'
submodules: 'recursive'
- name: Disable IPv6
shell: bash -l {0}
run: echo "DISABLE_IPV6=1" >> $GITHUB_ENV
- name: Install Dependencies
shell: bash
run : |
sudo apt-get update
sudo apt-get install -y build-essential cmake libcurl4-openssl-dev pkg-config libboost1.71-all-dev libasound-dev
- name: Compile Libraries
run : |
pushd lib/cryptopp/
make
sudo make install
popd
pushd lib/pjproject
cat >./pjlib/include/pj/config_site.h <<EOL
#define ENABLE_SIP_TCP 1
#define PJ_HAS_TCP 1
#define PJMEDIA_AUDIO_DEV_HAS_WASAPI 0
#define PJMEDIA_AUDIO_DEV_HAS_WMME 0
EOL
cat ./pjlib/include/pj/config_site.h
./configure
make realclean
make dep
make
sudo make install
popd
- name: Build Project
run : |
pushd tinyphone-linux
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: tinyphone.linux
path: |
./tinyphone-linux/build/tinyphone