simplify call of python scripts #240
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
name: mechanics_clamp_build | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
# only trigger on branches, not on tags | |
branches: '**' | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: install openscad | |
run: sudo apt-get update && sudo apt-get install -y openscad | |
- name: set environment variable | |
run: echo MY_VERSION_ID=$(echo $GITHUB_REF_NAME | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+") >> $GITHUB_ENV | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: build | |
run: | | |
cd ./Shared/mechanics/clamp | |
echo version: $MY_VERSION_ID | |
openscad --hardwarnings -D "ver=\"$MY_VERSION_ID\"" -o clamp.stl clamp.scad | |
- name: upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: clamp | |
path: | | |
./Shared/mechanics/clamp/clamp.stl | |
./Shared/mechanics/clamp/3d_print_instructions |