From 58321356d6cd176dba63c95036cb43e4e2ea0af3 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sun, 4 May 2025 16:14:15 +0200 Subject: [PATCH] Set up CI --- .forgejo/workflows/stl.yaml | 50 +++++++++++++++++++++++++++++++++++++ ci-template.scad | 3 +++ 2 files changed, 53 insertions(+) create mode 100644 .forgejo/workflows/stl.yaml create mode 100644 ci-template.scad diff --git a/.forgejo/workflows/stl.yaml b/.forgejo/workflows/stl.yaml new file mode 100644 index 0000000..bbca30c --- /dev/null +++ b/.forgejo/workflows/stl.yaml @@ -0,0 +1,50 @@ +name: Create STL + +on: + workflow_dispatch: + inputs: + label: + description: 'Your name' + default: 'Zero Cool' + required: true + type: string + icon: + description: 'Little icon above the label' + default: thing-logos/glider.dxf + type: choice + required: false + options: + - thing-logos/glider.dxf + - thing-logos/camprocket.dxf + - thing-logos/Club_mate_logo.dxf + - thing-logos/chaosknoten.dxf + +jobs: + + stl: + runs-on: docker + container: + image: node:alpine + + steps: + - name: Install depdencies + run: apk add git openscad envsubst + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Generate OpenSCAD file + run: cat ci-template.scad | envsubst | tee ci.scad + env: + LABEL: "${{ inputs.label }}" + ICON: "${{ inputs.icon }}" + + - name: Render to STL + run: openscad --export-format binstl -o ci.stl ci.scad + + - uses: actions/upload-artifact@v4 + with: + name: bottle-clip.stl + path: ci.stl + overwrite: true diff --git a/ci-template.scad b/ci-template.scad new file mode 100644 index 0000000..50d756a --- /dev/null +++ b/ci-template.scad @@ -0,0 +1,3 @@ +include + +bottle_clip(name="$LABEL", logo="$ICON");