-
Notifications
You must be signed in to change notification settings - Fork 10
155 lines (132 loc) · 5.18 KB
/
mac-x64.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
name: Build on macOS-x64
permissions:
contents: write
discussions: write
on:
push:
paths-ignore:
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.clang-*'
- '.gitignore'
- '.github/**'
- '!.github/workflows/mac-x64.yml'
- 'lib/xdg/**'
- 'snap/**'
- 'docs/**'
- 'flatpak/**'
- 'vcpkg.json'
- 'vcpkg-*.json'
- 'src/base/platform/win/**'
- 'src/base/platform/linux/**'
branches: [ develop, develop-macos ]
tags:
- "v*.*.*"
pull_request:
branches: [ develop, develop-macos ]
jobs:
macos:
name: MacOS-X64
runs-on: macos-13
strategy:
matrix:
build_type: [ Release ]
env:
UPLOAD_ARTIFACT: "false"
ONLY_CACHE: "false"
PREPARE_PATH: "build-script/prepare-mac.sh"
steps:
- name: Get repository name.
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v2
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
- name: First set up.
run: |
sudo chown -R `whoami`:admin /usr/local/share
brew install automake
# Disable spotlight.
sudo mdutil -a -i off
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Prepare
run: |
chmod a+x ./$REPO_NAME/$PREPARE_PATH
./$REPO_NAME/$PREPARE_PATH
- name: Build ok-gloox
run: |
git clone https://github.com/okstar-org/ok-gloox.git
cd ok-gloox
cmake -B out -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build out --config ${{ matrix.build_type }}
sudo cmake --install out --config ${{ matrix.build_type }}
- name: Build ok-rtc
run: |
git clone -b master https://github.com/okstar-org/ok-rtc.git
cd ok-rtc
git submodule update --init
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/mozjpeg/lib/pkgconfig:/usr/local/opt/ffmpeg@5/lib/pkgconfig"
cmake -B out -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DJPEG_LIBRARY=/usr/local/opt/mozjpeg/lib -DJPEF_INCLUDE_DIR=/usr/local/opt/mozjpeg/include
cmake --build out --config=${{ matrix.build_type }}
sudo cmake --install out --config ${{ matrix.build_type }}
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
modules: 'qtwebengine'
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ env.REPO_NAME }}/${{ github.workspace }}/out" >> "$GITHUB_OUTPUT"
- name: CMake Configure
run: |
export PKG_CONFIG_PATH="/usr/local/opt/mozjpeg/lib/pkgconfig:/usr/local/opt/ffmpeg@5/lib/pkgconfig:/usr/local/opt/openal-soft/lib/pkgconfig"
cmake -B ${{ steps.strings.outputs.build-output-dir }} -S ${{ github.workspace }}/${{ env.REPO_NAME }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: CMake Build
run: |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Decode and import certificate
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo "$MACOS_CERTIFICATE" | base64 --decode -o cert.p12
security create-keychain -p "" build.keychain
security import cert.p12 -k build.keychain -P $CERTIFICATE_PASSWORD -T /usr/bin/codesign
security list-keychains -s build.keychain
security unlock-keychain -p "" build.keychain
security set-keychain-settings build.keychain
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
security find-identity -v -p codesigning
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- name: install create-dmg
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
brew install node
node -v
npm -v
sudo npm install --global create-dmg
create-dmg --version
security find-identity -v -p codesigning
- name: macdeployqt
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
${{env.Qt5_DIR}}/bin/macdeployqt ${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop.app
- name: create dmg
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
create-dmg --help
create-dmg --identity="Apple Development: [email protected] (DBN79CF4VB)" ${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop.app ${{ steps.strings.outputs.build-output-dir }}/bin/
env:
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Upload to release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ steps.strings.outputs.build-output-dir }}/bin/ok-msg-desktop macOS-x64.dmg