more updates for kcl-samples (#5696)
* screenshots and step Signed-off-by: Jess Frazelle <github@jessfraz.com> * automations Signed-off-by: Jess Frazelle <github@jessfraz.com> * add manifest generation Signed-off-by: Jess Frazelle <github@jessfraz.com> * small refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * update readme Signed-off-by: Jess Frazelle <github@jessfraz.com> * write the readme Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes for comments Signed-off-by: Jess Frazelle <github@jessfraz.com> * derive-docs tests updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update all the generated artifact commands, since we dont need to clear scene at the start of run so we dont need to recreate all the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
9
.github/workflows/generate-website-docs.yml
vendored
9
.github/workflows/generate-website-docs.yml
vendored
@ -5,6 +5,7 @@ on:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
- 'docs/**'
|
||||
- 'public/kcl-samples/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
@ -42,6 +43,14 @@ jobs:
|
||||
# move new
|
||||
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
|
||||
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
||||
- name: move kcl-samples
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p documentation/content/pages/docs/kcl-samples
|
||||
# cleanup old
|
||||
rm -rf documentation/content/pages/docs/kcl-samples/*
|
||||
# move new
|
||||
mv -f public/kcl-samples/* documentation/content/pages/docs/kcl-samples/
|
||||
- name: commit the changes in the docs repo
|
||||
shell: bash
|
||||
run: |
|
||||
|
52
.github/workflows/kcl-samples-manifest.yml
vendored
52
.github/workflows/kcl-samples-manifest.yml
vendored
@ -1,52 +0,0 @@
|
||||
name: KCL Samples Manifest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch: # Allows manual triggering from the Actions tab
|
||||
|
||||
jobs:
|
||||
generate-manifest:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Set up Node.js
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
# Run the script to generate the manifest.json
|
||||
- name: Run manifest generation script
|
||||
working-directory: public/kcl-samples
|
||||
run: node generate-manifest.js
|
||||
|
||||
# Check if the manifest.json has changed
|
||||
- name: Check for changes
|
||||
id: check-for-changes
|
||||
working-directory: public/kcl-samples
|
||||
run: |
|
||||
git diff --exit-code ./manifest.json || echo "changed=changes detected" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Stage and commit the changes if any were made
|
||||
- name: Commit and push changes
|
||||
if: ${{ success() && (steps.check-for-changes.outputs.changed == 'changes detected') }}
|
||||
working-directory: public/kcl-samples
|
||||
run: |
|
||||
git add ./manifest.json
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
git commit -m "Update manifest.json"
|
||||
git push origin ${{ github.head_ref }}
|
64
.github/workflows/pr-kcl-samples-repo.yml
vendored
64
.github/workflows/pr-kcl-samples-repo.yml
vendored
@ -1,64 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'public/kcl-samples/**'
|
||||
# pull_request:
|
||||
# paths:
|
||||
# - .github/workflows/pr-kcl-samples-repo.yml
|
||||
workflow_dispatch:
|
||||
name: Create PR in kcl-samples repo
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
pr-kcl-samples-repo:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
# required
|
||||
app-id: ${{ secrets.GH_ORG_APP_ID }}
|
||||
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
# Checkout the other repo since we want to update the files there.
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'KittyCAD/kcl-samples'
|
||||
ref: next
|
||||
path: kcl-samples-repo
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Move files to repo work tree
|
||||
shell: bash
|
||||
run: |
|
||||
rsync -av --delete \
|
||||
--exclude='.git' \
|
||||
--exclude='.github' \
|
||||
--exclude='screenshots' \
|
||||
--exclude='step' \
|
||||
public/kcl-samples/ kcl-samples-repo/
|
||||
- name: Commit the changes in the repo
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd kcl-samples-repo
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
export NEW_BRANCH="update-from-modeling-app"
|
||||
git switch -c "$NEW_BRANCH"
|
||||
git add --all .
|
||||
git commit -m "Updates from modeling-app repo" || exit 0
|
||||
git push -f origin "$NEW_BRANCH"
|
||||
gh pr create --title "Update from modeling-app" \
|
||||
--body "Updating files from the modeling-app repo" \
|
||||
--head "$NEW_BRANCH" \
|
||||
--reviewer jtran \
|
||||
--base next || true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
Reference in New Issue
Block a user