Skip to content

add workflow for testing and releasing #14

add workflow for testing and releasing

add workflow for testing and releasing #14

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: Cache STL Files
id: cache-stl
uses: actions/cache@v4
with:
path: cache
key: stlcache-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
stlcache-${{ runner.os }}
- name: read cache
run: .github/workflows/getcache
- name: build
run: make -j $(nproc)
- name: create cache
run: .github/workflows/mkcache
- name: Publish STL files
uses: actions/upload-artifact@v4
with:
name: stl-files
path: stl
- name: Get Release Information
id: release_info
if: github.event_name == 'release'
run: |
echo "::set-output name=upload_url::${{ github.event.release.upload_url }}"
- name: Upload Artifact to Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: stl
asset_name: stl-files.zip
asset_content_type: application/zip