Skip to content

Export MCAD

Export MCAD #80

Workflow file for this run

name: Export MCAD
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
export-mcad:
name: Export MCAD
runs-on: ubuntu-22.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 qtbase5-dev
python3 -m pip install --upgrade pip
pip install pyside2==5.15.2.1
- name: Fetch FreeCAD
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "FreeCAD/FreeCAD"
version: "tags/0.21.2"
file: "FreeCAD-0.21.2-Linux-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/lumenpnp/lumenpnp/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/lumenpnp/lumenpnp/LumenPnP-STLs-${{ github.event.release.tag_name }}.zip *.stl
cd ../csm-export
if [ -f "*.dxf" ]; then
zip -9 -j /home/runner/work/lumenpnp/lumenpnp/LumenPnP-DXFs-${{ github.event.release.tag_name }}.zip *.dxf
fi
- name: Upload STLs as Artifacts
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: LumenPnP-STLs
path: .github/workflows/scripts/stl-export/*.stl
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: LumenPnP-DXFs
path: .github/workflows/scripts/csm-export/*.dxf
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: |
LumenPnP-STLs-${{ github.event.release.tag_name }}.zip
LumenPnP-DXFs-${{ github.event.release.tag_name }}.zip
fail_on_unmatched_files: false