-
Notifications
You must be signed in to change notification settings - Fork 4
123 lines (102 loc) · 3.33 KB
/
render_previews.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
name: Render previews
on:
push:
paths:
- '**.scad'
- '**.ini'
branches:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
env:
OPENSCAD_BIN: xvfb-run --auto-servernum ~/OpenSCAD.AppImage
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUBPAT }}
submodules: recursive
- name: Checkout repository and set original GitHub token
uses: actions/checkout@v2
with:
token: ${{ github.token }}
- name: Install requirements
run: |
uname -p
sudo apt update
sudo apt-get install libc-bin python3-setuptools xvfb
# HOW TO SPEED UP
# processor3d now can call it # FIXME: maybe we should prepare image for run multiple action instead of
# install requirements again in every job!
# see: https://docs.docker.com/build/ci/github-actions/share-image-jobs/
# even better reuse artifact (runner image) from previous run
# see: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
sudo apt-get install blender
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install stlsort lxml
sudo python3 -m pip install git+https://github.com/ThunderFly-aerospace/yagv
sudo python3 -m pip install git+https://${{ secrets.AUTH_USER }}:${{ secrets.GITHUBPAT }}@github.com/ThunderFly-aerospace/processor3D.git@blender
wget https://files.openscad.org/OpenSCAD-2021.01-x86_64.AppImage -O ~/OpenSCAD.AppImage
chmod +x ~/OpenSCAD.AppImage
~/OpenSCAD.AppImage --version
- name: Clean repo
run: |
rm CAD/png/*.png ||:
rm CAD/stl/*.stl ||:
rm CAD/amf/*.amf ||:
- name: Make -d CAD/src
run: |
cd CAD/src
make
- name: Make -d CAD/src/assembly/position
run: |
cd CAD/src/assembly/position
make
- name: Make -d CAD/src/assembly
run: |
cd CAD/src/assembly
make
- name: Upload a PNG Artifact
uses: actions/[email protected]
with:
name: 'render_png'
path: './**/*.png'
- name: Upload a STL Artifact
uses: actions/[email protected]
with:
name: 'render_stl'
path: './**/*.stl'
- name: publish to git
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatic commit from workflow
Update_blender:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
# with:
# token: ${{ secrets.GITHUBPAT }}
# submodules: recursive
#
# - name: Checkout repository and set original GitHub token
# uses: actions/checkout@v2
# with:
# token: ${{ github.token }}
- name: install blender
run: |
sudo apt update
sudo apt-get install blender
- name: Update blender
run: |
cd CAD/blender
./update_blend_file.sh
- name: Checkout repository and set original GitHub token
uses: actions/checkout@v2
- name: publish to git
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatic commit from workflow