forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (116 loc) · 4.7 KB
/
deploy-release.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
# SPDX-FileCopyrightText: 2022 Pablo Delgado Krämer
# SPDX-License-Identifier: MIT
name: Deploy Release
on: [push, workflow_dispatch]
defaults:
run:
shell: bash
jobs:
build:
strategy:
matrix:
include:
- name: Linux
image: ubuntu-20.04
- name: MacOS
image: macos-12
- name: Windows
image: windows-2019
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.image }}
steps:
- name: Set up packages (Linux)
if: matrix.name == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake libgl1-mesa-dev libglu1-mesa-dev python3-pip qtbase5-dev-tools
- name: Set up packages (MacOS)
if: matrix.name == 'MacOS'
run: |
brew install qt pyenv
# Build fails because system-wide packages are detected; remove them
brew uninstall --ignore-dependencies openexr imath libpng
- name: Set up Python (MacOS)
if: matrix.name == 'MacOS'
run: |
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.7.13
pyenv global 3.7.13
echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
# Needed for pyside6-uic binary
echo "$HOME/Library/Python/3.7/bin" >> $GITHUB_PATH
- name: Install NASM (Windows)
if: matrix.name == 'Windows'
uses: ilammy/setup-nasm@v1.4.0
- name: Install Python packages (Linux & Windows)
if: matrix.name != 'MacOS'
run: pip install --user PySide2 PyOpenGL
- name: Install Python packages (MacOS)
if: matrix.name == 'MacOS'
run: pip install --user PySide6 PyOpenGL
- name: Check out repository
uses: actions/checkout@v3
- name: Set up MSVC environment (Windows)
if: matrix.name == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.12.0
with:
vsversion: 2019
- name: Build USD (Windows)
if: matrix.name == 'Windows'
run: |
# Build on C: drive because of out-of-disk-space errors on D:
python build_scripts/build_usd.py --generator "Visual Studio 16 2019" --verbose --materialx --openimageio --no-examples --no-tutorials C:/INSTALL --build-args USD,"-DPXR_PYTHON_SHEBANG=\"/usr/bin/env python3\""
echo "USD_INSTALL_DIR=C:/INSTALL" >> $GITHUB_ENV
- name: Build USD (Linux)
if: matrix.name == 'Linux'
run: |
# Force build of OIIO's idiff tool (for graphical tests which we only run on Linux)
python build_scripts/build_usd.py --verbose --materialx --openimageio --no-examples --no-tutorials INSTALL --build-args USD,"-DPYSIDEUICBINARY:PATH=/usr/lib/qt5/bin/uic" OpenImageIO,"-DOIIO_BUILD_TOOLS=ON"
echo "USD_INSTALL_DIR=$PWD/INSTALL" >> $GITHUB_ENV
- name: Build USD (MacOS)
if: matrix.name == 'MacOS'
run: |
python build_scripts/build_usd.py --verbose --materialx --openimageio --no-examples --no-tutorials INSTALL
echo "USD_INSTALL_DIR=$PWD/INSTALL" >> $GITHUB_ENV
- name: Patch rpaths (MacOS)
if: matrix.name == 'MacOS'
working-directory: ${{ env.USD_INSTALL_DIR }}/lib
run: |
for USD_LIB in ./libusd*; do
install_name_tool -change $HOME/.pyenv/versions/3.7.13/Library/Frameworks/Python.framework/Versions/3.7/Python @rpath/libpython3.7m.dylib $USD_LIB
done
- name: Remove redundant files
working-directory: ${{ env.USD_INSTALL_DIR }}
run: rm -rf build src doc share resources/*
- name: Patch MaterialX installation
run: patch -p1 -u -d ${{ env.USD_INSTALL_DIR }} < .github/MaterialX_patch.diff
- name: Determine archive file name
run: |
PYTHON_SHORT_VERSION=$(python --version 2>&1 | grep -o "[0-9]\.[0-9]\+")
echo "USD_ARCHIVE_FILE_NAME=USD22.11_${{ matrix.name }}_x64_Python${PYTHON_SHORT_VERSION}.tar.gz" >> $GITHUB_ENV
- name: Create archive
working-directory: ${{ env.USD_INSTALL_DIR }}
run: tar -zcvf ${{ env.USD_ARCHIVE_FILE_NAME }} *
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ${{ env.USD_INSTALL_DIR }}/${{ env.USD_ARCHIVE_FILE_NAME }}
retention-days: 1
deploy:
name: Deploy Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Deploy draft release
uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
with:
name: "Version 22.11 with MaterialX support"
files: |
*.tar.gz
fail_on_unmatched_files: true
body: "Built for [guc](https://github.com/pablode/guc)'s and [gatling](https://github.com/pablode/gatling)'s automatic workflows."
draft: true