-
Notifications
You must be signed in to change notification settings - Fork 5
152 lines (125 loc) · 4.81 KB
/
buildBS-mac.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
name: Electron CD Mac
on:
push:
tags:
- '*'
branches:
- 'test-build'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.11]
python-version: [3.8]
os: [macOS-12]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Brew Packages
run: |
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install cairo
brew install zlib
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Python dependencies
run: |
python3 --version
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt --no-binary=lxml
- name: Checkout Beamify
uses: actions/checkout@v3
with:
repository: flux3dp/beamify
ref: 2.0.5
token: ${{ secrets.REPO_TOKEN }}
path: .github/actions/beamify
- name: Install Beamify
run: |
cd .github/actions/beamify/python
# FIXME: Failed to install deps only on github action, use || operator temporary
python3 setup.py install --verbose || echo "Failed to install beamify"
- name: Install Fluxsvg
uses: flux3dp/fluxsvg@2.7.6
- name: Checkout FluxClient
uses: actions/checkout@v3
with:
repository: flux3dp/fluxclient-dev
ref: 2.8.4
token: ${{ secrets.REPO_TOKEN }}
path: .github/actions/fluxclient
- name: Install FluxClient
run: |
cd .github/actions/fluxclient
# FIXME: Failed to install deps only on github action, use || operator temporary
python3 setup.py install --verbose || echo "Failed to install fluxclient"
- name: Build Flux Api
uses: flux3dp/fluxghost@2.3.3
env:
LC_ALL: en_US.UTF-8
LC_CTYPE: en_US.UTF-8
- name: Checkout Beam Studio Core
uses: actions/checkout@v3
with:
repository: flux3dp/beam-studio-core
token: ${{ secrets.REPO_TOKEN }}
path: .github/actions/beam-studio-core
ref: develop
- name: Copy Beam Studio Core
run: |
cp -R .github/actions/beam-studio-core ../beam-studio-core
- name: Create Apple Certs
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
# It is said codesign --deep is not a good practice, but it is the only way to sign Swiftray successfully
# https://developer.apple.com/forums/thread/129980
- name: Build Beam Studio
run: |
mkdir backend
yarn install
yarn build
cp -R $HOME/flux_api_swap backend/flux_api
cp -R lib/monitorexe-osx backend/monitorexe-osx
./backend/flux_api/flux_api --test --without_pcl
curl https://swiftray-daemon.s3.ap-northeast-1.amazonaws.com/mac/swiftray-daemon.zip --output swiftray.zip
mkdir swiftray
tar -xf swiftray.zip -C ./swiftray
mv ./swiftray/Swiftray.app backend
rm ./swiftray.zip
find ./backend/Swiftray.app -name "*.txt" -delete
find ./backend/Swiftray.app -name "*.gcode" -delete
cp -R util/mac utils
sudo bash ./build/clearup-develop-files.sh
echo "Signing *.so files..."
find ./backend -name "*.so" | while read f ; do
codesign --force --verbose -s "Developer ID Application: FLUX TECHNOLOGY CORP. (4Y92JWKV94)" $f; done
echo "Signing Swiftray.app..."
codesign --deep --force --verbose -s "Developer ID Application: FLUX TECHNOLOGY CORP. (4Y92JWKV94)" ./backend/Swiftray.app
chmod -R 777 node_modules/font-scanner
yarn dist --publish always
env:
PUBLISH_BUCKET: beamstudio
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PUBLISH_PATH: ""
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLEID_DEAN }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS_DEAN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# - name: Cleanup artifacts
# run: |
# mkdir artifacts
# mv dist/*.dmg artifacts
# - name: Upload artifacts
# uses: actions/upload-artifact@v1
# with:
# name: ${{matrix.os}}
# path: artifacts