-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
}; |