-
Notifications
You must be signed in to change notification settings - Fork 17
78 lines (67 loc) · 2.54 KB
/
Copy pathTestBuild.yml
File metadata and controls
78 lines (67 loc) · 2.54 KB
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
name: Test Build
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
path: ${{ github.event.repository.name }}
- name: Cache Blender 4.2
id: cache-blender
uses: actions/cache@v6
with:
path: blender-download
key: blender-4.2-ubuntu-latest
- name: Download Blender 4.2
if: steps.cache-blender.outputs.cache-hit != 'true'
run: |
mkdir -p blender-download
pip install blender-downloader
blender-downloader 4.2 --extract --quiet --output-directory blender-download
- name: Locate Blender executable
id: blender
run: |
EXE=$(find blender-download -type f -iname blender | head -n 1)
if [ -z "$EXE" ]; then
echo "Could not find a Blender executable under blender-download/" >&2
exit 1
fi
chmod +x "$EXE"
echo "executable=$EXE" >> "$GITHUB_OUTPUT"
- name: Read id and version from blender_manifest.toml
id: manifest
run: |
python3 -c "
import tomllib
with open('${{ github.event.repository.name }}/blender_manifest.toml', 'rb') as f:
m = tomllib.load(f)
print(f\"id={m['id']}\")
print(f\"version={m['version']}\")
" >> "$GITHUB_OUTPUT"
- name: Set short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Validate extension manifest
run: |
"${{ steps.blender.outputs.executable }}" --command extension validate ${{ github.event.repository.name }}
- name: Build extension zip
run: |
mkdir -p dist
"${{ steps.blender.outputs.executable }}" --command extension build --source-dir ${{ github.event.repository.name }} --output-dir dist
- name: Extract built zip for artifact upload
run: |
mkdir -p "staging/${{ steps.manifest.outputs.id }}"
ZIP=$(find dist -maxdepth 1 -type f -iname "*.zip" | head -n 1)
if [ -z "$ZIP" ]; then
echo "Could not find a built extension zip under dist/" >&2
exit 1
fi
unzip -q "$ZIP" -d "staging/${{ steps.manifest.outputs.id }}"
- name: Upload zip as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.manifest.outputs.id }}_${{ steps.manifest.outputs.version }}_${{ steps.vars.outputs.short_sha }}
path: staging/
retention-days: 7