-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
172 additions
and
22 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,156 @@ | ||
name: render | ||
on: push | ||
jobs: | ||
render: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: download ninja binary | ||
run: curl -LO https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip | ||
|
||
- name: extract ninja binary | ||
run: unzip ninja-linux.zip | ||
|
||
- name: install ninja | ||
run: sudo install ninja /usr/local/bin/ | ||
|
||
- name: update system | ||
run: sudo apt-get update | ||
|
||
- name: install openscad | ||
run: sudo apt-get install -y --no-install-recommends openscad xvfb | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: render 3mf | ||
run: ninja a5-stop.3mf | ||
|
||
- name: add commit hash to 3mf filename | ||
run: mv a5-stop.3mf a5-stop_${{ github.sha }}.3mf | ||
|
||
- name: upload 3mf | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.3mf | ||
path: a5-stop_${{ github.sha }}.3mf | ||
|
||
- name: render stl | ||
run: ninja a5-stop.stl | ||
|
||
- name: add commit hash to stl filename | ||
run: mv a5-stop.stl a5-stop_${{ github.sha }}.stl | ||
|
||
- name: upload stl | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.stl | ||
path: a5-stop_${{ github.sha }}.stl | ||
|
||
- name: render png | ||
uses: coactions/setup-xvfb@v1 | ||
with: | ||
run: ninja a5-stop.png | ||
|
||
- name: add commit hash to png filename | ||
run: mv a5-stop.png a5-stop_${{ github.sha }}.png | ||
|
||
- name: upload png | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.png | ||
path: a5-stop_${{ github.sha }}.png | ||
|
||
github-release: | ||
needs: render | ||
runs-on: ubuntu-22.04 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: calculate new version | ||
uses: frabert/replace-string-action@v1.1 | ||
with: | ||
string: ${{ github.ref }} | ||
pattern: 'refs/tags/v' | ||
replace-with: '' | ||
id: version | ||
|
||
- name: download 3mf | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.3mf | ||
|
||
- name: download stl | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.stl | ||
|
||
- name: create github release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body: | | ||
![2d render](https://qguv.github.io/a5-stop/img/a5-stop_${{ steps.version.outputs.replaced }}.png) | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ steps.version.outputs.replaced }} | ||
draft: true | ||
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0.') }} | ||
id: create_release | ||
|
||
- name: upload 3mf as a release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: a5-stop_${{ github.sha }}.3mf | ||
asset_name: a5-stop_${{ steps.version.outputs.replaced }}.3mf | ||
asset_content_type: application/octet-stream | ||
|
||
- name: upload stl as a release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: a5-stop_${{ github.sha }}.stl | ||
asset_name: a5-stop_${{ steps.version.outputs.replaced }}.stl | ||
asset_content_type: application/octet-stream | ||
|
||
gh-pages-release: | ||
needs: render | ||
runs-on: ubuntu-22.04 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: calculate new version | ||
uses: frabert/replace-string-action@v1.1 | ||
with: | ||
string: ${{ github.ref }} | ||
pattern: 'refs/tags/v' | ||
replace-with: '' | ||
id: version | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: a5-stop_${{ github.sha }}.png | ||
|
||
- name: upload rendered image | ||
run: | | ||
mkdir -p gh-pages/img | ||
cp a5-stop_${{ github.sha }}.png gh-pages/img/a5-stop.png | ||
cp a5-stop_${{ github.sha }}.png gh-pages/img/a5-stop_${{ steps.version.outputs.replaced }}.png | ||
- name: deploy to github pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: gh-pages/ | ||
keep_files: true | ||
enable_jekyll: false |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.ninja_log | ||
pillstack.3mf | ||
*.3mf | ||
*.stl | ||
*.png |
This file was deleted.
Oops, something went wrong.
Submodule BOSL2
deleted from
46f783
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
# a5 alignment stop | ||
|
||
A5 alignment stop for the Dahle 507 paper cutter | ||
_also available [on Printables]()_ | ||
|
||
## building | ||
|
||
once you have the submodules (`git submodule update --init`), run `ninja` or `openscad -o a5.3mf a5.scad` | ||
![3d render of object](https://qguv.github.io/a5-stop/img/a5-stop.png) | ||
|
||
## animation | ||
Customizable, 3d-printable A5 alignment stop for the Dahle 507 paper cutter. | ||
|
||
some animations are included at the beginning of pillstack.scad. you can uncomment them (one at a time) to view them. from the OpenSCAD GUI, select View → Animate, then set FPS to 30 and Steps to 360 | ||
## building | ||
|
||
note: this seems to prevent OpenSCAD from automatically updating the preview when the source changes | ||
run `ninja` or `openscad -o a5.3mf a5.scad` |
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
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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
rule openscad | ||
rule render3d | ||
command = openscad -o $out $in | ||
|
||
build a5-stop.3mf: openscad a5-stop.scad | ||
rule render2d | ||
command = openscad --colorscheme BeforeDawn -o $out $in | ||
|
||
build a5-stop.3mf: render3d a5-stop.scad | ||
build a5-stop.stl: render3d a5-stop.scad | ||
build a5-stop.png: render2d a5-stop.scad |