Skip to content

Commit 7a1ffc8

Browse files
committed
Add macOS workflow
1 parent b8d8f2a commit 7a1ffc8

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.ci/macos_build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
find /usr/local/Cellar
4+
export CPATH=$CPATH:`echo /usr/local/Cellar/openssl@1.1/1.1.1*/include`
5+
export LIBRARY_PATH=`echo /usr/local/Cellar/openssl@1.1/1.1.1*/lib`
6+
.ci/common/build.sh macos
7+
8+
mkdir -p ${app_name}.app/Contents/Frameworks
9+
10+
for file in $(find . -type f -name "*.dylib"); do
11+
install_name_tool -change "$file" "@rpath/$file" "${app_name}.app/Contents/MacOS/${executable_name}"
12+
cp "$file" "${app_name}.app/Contents/Frameworks/"
13+
done
14+
15+
macdeployqt ${app_name}.app -qmldir=src
16+
17+
# TODO: Set up install screen
18+
#npm install -g appdmg
19+
#mv ${app_name}.app res/macos-release/
20+
#appdmg res/macos-release/scratchcpp-player.json ${app_name}.dmg

.github/workflows/macos-build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: macOS Build
2+
3+
on:
4+
push:
5+
branches: '*'
6+
tags: '*'
7+
pull_request:
8+
branches: [ "master" ]
9+
10+
jobs:
11+
build:
12+
runs-on: macos-latest
13+
strategy:
14+
matrix:
15+
os: [macos-latest]
16+
qt-version: ['6.8']
17+
qt-target: ['desktop']
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
submodules: true
23+
- name: Setup environment
24+
run: |
25+
sed -i -e '/^#/d' .github/config.env
26+
sed -i -e '/^$/d' .github/config.env
27+
cat .github/config.env >> "${GITHUB_ENV}"
28+
shell: bash
29+
- name: Set up node.js
30+
uses: actions/setup-node@v3
31+
# Install Qt
32+
- name: Install Qt
33+
uses: jurplel/install-qt-action@v3
34+
with:
35+
version: ${{ matrix.qt-version }}
36+
host: 'mac'
37+
target: ${{ matrix.qt-target }}
38+
modules: ''
39+
# Build
40+
- name: Build
41+
run: .ci/macos_build.sh
42+
shell: bash
43+
# Upload
44+
- name: Upload artifacts
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: build-Qt-${{ matrix.qt-version }}
48+
path: '*.dmg'

0 commit comments

Comments
 (0)