Skip to content

add workflow for testing and releasing #2

add workflow for testing and releasing

add workflow for testing and releasing #2

Workflow file for this run

name: Build Models
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install OpenSCAD
run: sudo apt-get install -y openscad
- uses: actions/checkout@v4
- name: build
run: make -j $(nproc)
- name: Publish STL files
uses: actions/upload-artifact@v4
with:
name: stl-files
path: stl
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Release ${{ github.ref }}
draft: false
prerelease: false
- name: Get Release ID
id: get_release_id
run: echo "RELEASE_ID=${{ steps.create_release.outputs.id }}" >> $GITHUB_ENV
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: '*.stl'
asset_name: stl-files.zip
asset_content_type: application/zip