Skip to content

Update kibot outputs dir #425

Update kibot outputs dir

Update kibot outputs dir #425

Workflow file for this run

name: Render 3D Designs
on:
push:
pull_request:
jobs:
render-3d:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up outputs directory
run: mkdir -p 3d/build/outputs
- name: Install dependencies
run: ./3d/scripts/dependencies.sh
- name: Generate 2d output
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python -u 3d/scripts/generate_2d.py --render-raster
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector.svg
cp 3d/build/laser_parts/raster.png 3d/build/outputs/3d_laser_raster.png
./scripts/annotate_image.sh 3d/build/outputs/3d_laser_raster.png
- name: Generate 2d output (Ponoko 3mm MDF)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --calculate-dimensions --kerf-preset ponoko-3mm-mdf
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-ponoko-3mm-mdf_1x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-ponoko-3mm-mdf_1x_dimensions.txt
- name: Generate 2d output (Ponoko 3mm Acrylic)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --calculate-dimensions --kerf-preset ponoko-3mm-acrylic
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-ponoko-3mm-acrylic_1x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-ponoko-3mm-acrylic_1x_dimensions.txt
- name: Generate 2d output (Ponoko 3mm MDF - 4x)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --calculate-dimensions --kerf-preset ponoko-3mm-mdf --panelize 4
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-ponoko-3mm-mdf_4x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-ponoko-3mm-mdf_4x.txt
- name: Generate 2d output (Ponoko 3mm Acrylic - 4x)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --calculate-dimensions --kerf-preset ponoko-3mm-acrylic --panelize 4
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-ponoko-3mm-acrylic_4x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-ponoko-3mm-acrylic_4x_dimensions.txt
- name: Generate 2d output (Elecrow 3mm Wood)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --kerf-preset elecrow-3mm-wood --render-elecrow
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-elecrow-3mm-wood_1x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-elecrow-3mm-wood_1x_dimensions.txt
cp 3d/build/laser_parts/elecrow.zip 3d/build/outputs/3d_laser_vector-elecrow-3mm-wood_1x.zip
- name: Generate 2d output (Elecrow 3mm Acrylic)
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_2d.py --kerf-preset elecrow-3mm-acrylic --render-elecrow
cp 3d/build/laser_parts/combined.svg 3d/build/outputs/3d_laser_vector-elecrow-3mm-acrylic_1x.svg
cp 3d/build/laser_parts/combined_dimensions.txt 3d/build/outputs/3d_laser_vector-elecrow-3mm-acrylic_1x_dimensions.txt
cp 3d/build/laser_parts/elecrow.zip 3d/build/outputs/3d_laser_vector-elecrow-3mm-acrylic_1x.zip
- name: Generate animated gif
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_gif.py
cp 3d/build/animation/animation.gif 3d/build/outputs/3d_animation.gif
cp 3d/build/animation/all_flaps.gif 3d/build/outputs/all_flaps.gif
- name: Generate STLs for web viewer
run: |
python -u 3d/scripts/generate_stl.py
cp -r 3d/build/colored_stl 3d/build/outputs/3d_colored_stl
gzip 3d/build/outputs/3d_colored_stl/*.stl
- name: Archive artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: 3d
path: |
3d/build
- name: Configure AWS Credentials
if: github.event_name == 'push' && github.repository_owner == 'scottbez1'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Sync artifacts to S3
if: github.event_name == 'push' && github.repository_owner == 'scottbez1'
run: |
aws s3 sync 3d/build/outputs s3://splitflap-artifacts/${GITHUB_REF#refs/heads/}/3d --exclude '3d_colored_stl/*.stl.gz' --delete --acl public-read --cache-control max-age=0,no-cache
aws s3 sync 3d/build/outputs s3://splitflap-artifacts/${GITHUB_REF#refs/heads/}/3d --exclude '*' --include '3d_colored_stl/*.stl.gz' --delete --content-encoding gzip --acl public-read --cache-control max-age=0,no-cache