-
Notifications
You must be signed in to change notification settings - Fork 37
98 lines (83 loc) · 2.74 KB
/
export-mcad.yaml
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
name: Export MCAD
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
export-mcad:
name: Export MCAD
runs-on: ubuntu-20.04
steps:
- name: Generate Short SHA Environment Variable
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Download repository
uses: actions/checkout@v2
- name: Install FreeCAD Python library
run: |
sudo apt -qq update
sudo apt-get -qq -y install python3
sudo apt-get -qq -y install python3-pip
sudo apt-get -qq -y install qt5-default
python3 -m pip install --upgrade pip
pip install pyside2==5.12.6
- name: Fetch FreeCAD
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "FreeCAD/FreeCAD"
version: "tags/0.19.2"
file: "FreeCAD_0.19-24291-Linux-Conda_glibc2.12-x86_64.AppImage"
target: "FreeCAD.AppImage"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install FreeCad
run: |
sudo chown runner:docker FreeCAD.AppImage
pwd
chmod +x FreeCAD.AppImage
./FreeCAD.AppImage --appimage-extract > /dev/null
- name: Generate DXF files
run: |
cd .github/workflows/scripts
python3 export-csm.py
pwd
ls -al
cd csm-export
ls -al
env:
LD_LIBRARY_PATH: /home/runner/work/feeder/feeder/squashfs-root/usr/lib
- name: Generate STL files
run: |
cd .github/workflows/scripts
python3 export-stl.py
- name: Compress STL and DXF files for Release
if: github.event_name == 'release'
run: |
cd .github/workflows/scripts/stl-export
zip -9 -j /home/runner/work/feeder/feeder/Feeder-STLs-${{ github.event.release.tag_name }}.zip *.stl
cd ../csm-export
- name: Compress STL and DXF files for Artifacts
if: github.event_name != 'release'
run: |
cd .github/workflows/scripts/stl-export
zip -9 -j ~/Feeder-STLs.zip *.stl
cd /home/runner/work/feeder/feeder/.github/workflows/scripts/csm-export
- name: Upload STLs as Artifacts
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: Feeder-STLs
path: ~/Feeder-STLs.zip
if-no-files-found: error
retention-days: 60
- name: Upload DXFs as Artifacts
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: Feeder-DXFs
path: ~/Feeder-DXFs.zip
if-no-files-found: warn
retention-days: 60
- name: Upload STLs and DXFs Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: Feeder-STLs-${{ github.event.release.tag_name }}.zip