-
-
Notifications
You must be signed in to change notification settings - Fork 97
145 lines (122 loc) · 4.71 KB
/
fake-bpy-module-latest-build.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
---
# yamllint disable rule:line-length
name: fake-bpy-module Latest Build
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
push:
branches:
- 'run-ci/**'
jobs:
set_versions:
name: Set build versions
runs-on: ubuntu-latest
outputs:
module_version: ${{ steps.set_module_version.outputs.module_version }}
file_version: ${{ steps.set_file_version.outputs.file_version }}
steps:
# Use ISO 8601 date (in UTC) + timestamp (in UTC)
- name: Create generic module version
run: echo "MODULE_VERSION=$(date -u +%Y%m%d).dev$(date -u +%H%M%S)" >> $GITHUB_ENV
# Use ISO 8601 date (in UTC) for a scheduled release
- name: Create generic module version
if: github.event_name == 'schedule'
run: echo "MODULE_VERSION=$(date -u +%Y%m%d)" >> $GITHUB_ENV
# Set module version output
- name: Set module version
id: set_module_version
run: echo ::set-output name=module_version::${MODULE_VERSION}
# Use ISO 8601 timestamps (in UTC) for output/file version
- name: Set file version
id: set_file_version
run: echo ::set-output name=file_version::$(date -u +%Y%m%dT%H%M%SZ)
build_modules:
name: Build modules
runs-on: ubuntu-22.04
needs: [set_versions]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test fake_bpy_module core module
run: bash tests/run_pre_tests.sh src
- name: Install Blender binary dependencies
run: |
sudo apt update
sudo apt install -y libglu1-mesa libegl1
- name: Install fake-bpy-module tools
run: sudo apt install -y pandoc
- name: Download latest Blender files from nutti/blender-daily-build artifacts
run: bash tools/utils/download_latest_blender.sh nutti blender-daily-build "Blender daily build" ./blender-bin ${{ secrets.TOKEN_FOR_ACTION_BLENDER_DAILY_BUILD }}
# alternatively to the github checkout, you can also use git.blender.org. See below.
- name: Checkout Blender from Github
uses: actions/checkout@v2
with:
repository: "blender/blender"
path: blender
- name: Generate pip Packages
env:
RELEASE_VERSION: ${{ needs.set_versions.outputs.module_version }}
run: bash tools/pip_package/build_pip_package.sh release latest ./blender ./blender-bin/blender-latest-bin
- name: Archive pip packages
uses: actions/upload-artifact@v2
with:
name: fake_bpy_modules_latest_pip_${{ needs.set_versions.outputs.file_version }}
path: release
- name: Archive raw modules
uses: actions/upload-artifact@v2
with:
name: fake_bpy_modules_latest_raw_${{ needs.set_versions.outputs.file_version }}
path: "raw_modules/fake_bpy_module*"
- name: Test Generated Modules
run: bash tests/run_tests.sh raw_modules
- name: Test generated pip module against Cycles addon
run: bash tests/pylint_cycles.sh latest ./blender/ ./release/latest/fake_bpy_module_latest-*-py3-none-any.whl
- name: Collect failure state
if: failure()
run: bash tools/collect_failure_state/collect_failure_state.sh /tmp/failure_state
- name: Store failure state
if: failure()
uses: actions/upload-artifact@v2
with:
name: failure_state
path: /tmp/failure_state
pypi_release_test:
name: PyPI Release test
needs: [build_modules]
runs-on: ubuntu-latest
steps:
- name: Fetch artifacts
uses: actions/download-artifact@v2
with:
path: dist
# Publish to TestPyPi on each merge to master
- name: Publish distribution 📦 to Test PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.test_pypi_token }}
repository_url: https://test.pypi.org/legacy/
packages_dir: "dist/fake_bpy_modules_latest_pip_*/*/"
pypi_release:
name: PyPI Release fake-bpy-module
needs: [pypi_release_test]
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Fetch Artifacts
uses: actions/download-artifact@v2
with:
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_token }}
packages_dir: "dist/fake_bpy_modules_latest_pip_*/*/"