Skip to content

Commit

Permalink
initial setup (#1)
Browse files Browse the repository at this point in the history
Add a workflow that produces STL and png artifact from .scad file. Then converts the STL it to obj and step with KittyCAD, and if the workflow is triggered by a tag push, then make a release.
  • Loading branch information
Irev-Dev authored Jun 12, 2022
1 parent a066a20 commit f8529da
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/create-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: create artifacts
on:
pull_request:
push:
tags:
- '*'

jobs:
create-artifacts:
runs-on: ubuntu-latest
name: create artifacts
steps:
- uses: actions/checkout@v3
- uses: Irev-Dev/action-install-openscad-nightly@v0.0.1
- name: create stl
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" openscad-nightly -o ./output.stl --export-format "asciistl" ./demo-thing.scad
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" openscad-nightly -o ./output.png --imgsize=1000,300 --camera=-0.4,1.3,2.5,68,0,58,39 ./demo-thing.scad
- uses: KittyCAD/install-cli@v0.0.4
- name: convert
run: |
kittycad file convert output.stl output.obj
kittycad file convert output.stl output.step
ls
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
- uses: actions/upload-artifact@v3
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
name: outputs
path: ./output.*
- uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
artifacts: "./output.stl, ./output.obj, ./output.step, ./output.png"
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions demo-thing.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$fn=30;

union() {
translate([2.5,0,0])rotate([0,-90,0])linear_extrude(5)polygon([
[0, 2],
[0, -2],
[2, 0]
]);

translate([0,0,2])rotate([10,0,0])translate([-2.5, -12, 0])cube([5, 24, 1]);
translate([0, 10, 6.5])rotate([10,0,0])sphere(2);
translate([0, -10, 3])rotate([10,0,0])sphere(2);

};

0 comments on commit f8529da

Please sign in to comment.