-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (144 loc) · 5.02 KB
/
build_macos.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
name: Build bpy for macOS
on:
workflow_dispatch:
inputs:
tag:
description: 'Blender Tag to build'
required: true
python_version:
description: 'Python version to use'
required: true
default: '3.10.11'
workflow_call:
inputs:
tag:
description: 'Blender Tag to build'
required: true
type: string
python_version:
description: 'Python version to use'
required: true
default: '3.10.11'
type: string
jobs:
build:
runs-on: macos-13
permissions:
contents: write
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Set environment variables
id: set_env
run: |
TAG=${{ inputs.tag || github.event.inputs.tag }}
PYTHON_VERSION=${{ inputs.python_version || github.event.inputs.python_version }}
echo "TAG=$TAG" >> $GITHUB_ENV
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
- name: Checkout Blender repository recursively
uses: actions/checkout@v2
with:
repository: blender/blender
ref: ${{ env.TAG}}
submodules: 'recursive'
path: blender
# - name: Set up Conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: 3.10.13
# activate-environment: bpy-env
# channels: conda-forge
# miniconda-version: "latest"
- name: Set up Python
run: |
brew install --overwrite [email protected] [email protected]
- name: Install Python Dependencies
run: |
pip install -r ./requirements.txt
- name: Build Blender
run: |
python workspace/build_blender.py build --tag ${{ env.TAG }} --install --publish
env:
GITHUB_TOKEN: ${{ github.token }}
# - name: Install Conda Dependencies
# run: |
# conda install -y setuptools -c conda-forge
# - name: Add conda subdirectories to PATH
# run: |
# for dir in $(find /Users/runner/conda_pkgs_dir/ -mindepth 1 -type d); do
# echo "$dir" >> $GITHUB_PATH
# done
- name: Install dependencies
run: |
brew install cmake subversion
# - name: Cache Blender dependencies
# uses: actions/cache@v2
# with:
# path: |
# ./lib
# key: ${{ runner.os }}-blender-deps-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-blender-deps-
# - name: Install Cuda Toolkit
# uses: Jimver/[email protected]
# id: cuda-toolkit
# with:
# cuda: '12.1.0'
# - name: Cache build files (for testing only)
# uses: actions/cache@v2
# with:
# path: |
# ./build_darwin_bpy
# key: ${{ runner.os }}-blender-build-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-blender-build-
# - name: Download Blender Python API Stubs
# uses: actions/download-artifact@v2
# with:
# workflow: generate_stubs.yml
# name: blender-python-api-stubs-${{ github.event.inputs.tag }}
# path: ./build_darwin_bpy/bin/
# - name: Download Blender Python API Stubs
# id: download-artifact
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: build_all.yml
# # github_token: ${{secrets.GITHUB_TOKEN}}
# name: blender-python-api-stubs-${{ env.TAG }}
# path: ./build_darwin_bpy/bin/
# - name: Download Blender Python API Stubs
# id: download-artifact
# uses: actions/download-artifact@v4
# with:
# name: blender-python-api-stubs-${{ env.TAG }}
# path: ./build_darwin_bpy/bin/
# - name: Build Blender
# run: |
# cd ./blender
# make update
# make bpy
# - name: Setup terminal session
# uses: fawazahmed0/action-debug@main
# with:
# credentials: "user:p@ss!"
# - name: Make Wheel
# run: |
# pip install -U pip setuptools wheel
# cp ./workspace/make_bpy_wheel.py ./blender/build_files/utils/
# python ./blender/build_files/utils/make_bpy_wheel.py ./build_darwin_bpy/bin/
# # - name: Upload Wheel as Artifact
# # uses: actions/upload-artifact@v2
# # with:
# # name: bpy-macos
# # path: |
# # ./build_darwin_bpy/bin/*.whl
# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip requests urllib3 ndg-httpsclient pyopenssl pyasn1
# pip install -r requirements.txt
# pip install ndg-httpsclient pyopenssl pyasn1
# - name: Publish Wheel
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: python workspace/build_blender.py publish-github ${{ env.TAG}} ./build_darwin_bpy/bin/