Skip to content

Commit 8880ae1

Browse files
committed
Initial release: MICRORACK Specification v1.0
0 parents  commit 8880ae1

File tree

13 files changed

+696
-0
lines changed

13 files changed

+696
-0
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag name for the release (e.g., v1.0)'
8+
required: true
9+
type: string
10+
title:
11+
description: 'Release title'
12+
required: true
13+
type: string
14+
prerelease:
15+
description: 'Mark as pre-release'
16+
required: false
17+
type: boolean
18+
default: false
19+
generate_notes:
20+
description: 'Auto-generate release notes'
21+
required: false
22+
type: boolean
23+
default: true
24+
25+
jobs:
26+
release:
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Create Release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
tag_name: ${{ inputs.tag }}
38+
name: ${{ inputs.title }}
39+
prerelease: ${{ inputs.prerelease }}
40+
generate_release_notes: ${{ inputs.generate_notes }}

.github/workflows/sync-to-site.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Sync Markdown to Site Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
actions: write
12+
13+
jobs:
14+
sync:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout master branch
18+
uses: actions/checkout@v4
19+
with:
20+
ref: master
21+
fetch-depth: 0
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.x'
27+
28+
- name: Configure Git
29+
run: |
30+
git config user.name "github-actions[bot]"
31+
git config user.email "github-actions[bot]@users.noreply.github.com"
32+
33+
- name: Sync markdown files to site branch
34+
run: |
35+
# Fetch all branches
36+
git fetch origin
37+
38+
# Check if site branch exists
39+
if git show-ref --verify --quiet refs/remotes/origin/site; then
40+
git checkout site
41+
git pull origin site
42+
else
43+
echo "Error: site branch does not exist. Please create it first."
44+
exit 1
45+
fi
46+
47+
mkdir -p docs/specs
48+
49+
# Get the conversion script from site branch
50+
CONVERT_SCRIPT="scripts/convert_admonitions.py"
51+
52+
# Sync README.md from master root -> docs/index.md
53+
# Convert GitHub markdown to MkDocs format (links + admonitions)
54+
git show master:README.md | sed \
55+
-e 's|\[Mechanical Specs\](mechanical/)|[Mechanical Specs](specs/mechanical.md)|g' \
56+
-e 's|\[Electrical Specs\](electrical/)|[Electrical Specs](specs/electrical.md)|g' \
57+
| python3 "$CONVERT_SCRIPT" > docs/index.md
58+
59+
# Sync LICENSE.md from master root -> docs/LICENSE.md
60+
git show master:LICENSE.md > docs/LICENSE.md 2>/dev/null || true
61+
62+
# Sync mechanical/README.md -> docs/specs/mechanical.md
63+
# Convert GitHub markdown links and admonitions to MkDocs format
64+
git show master:mechanical/README.md 2>/dev/null | sed \
65+
-e 's|\[Electrical\](../electrical/)|[Electrical](electrical.md)|g' \
66+
| python3 "$CONVERT_SCRIPT" > docs/specs/mechanical.md || true
67+
68+
# Sync electrical/README.md -> docs/specs/electrical.md
69+
# Convert GitHub markdown links and admonitions to MkDocs format
70+
git show master:electrical/README.md 2>/dev/null | sed \
71+
-e 's|\[Mechanical\](../mechanical/)|[Mechanical](mechanical.md)|g' \
72+
| python3 "$CONVERT_SCRIPT" > docs/specs/electrical.md || true
73+
74+
# Sync images from mechanical/ and electrical/ -> docs/specs/
75+
for ext in png jpg jpeg gif svg webp; do
76+
for file in $(git ls-tree --name-only master:mechanical/ 2>/dev/null | grep -E "\.$ext$" || true); do
77+
git show "master:mechanical/$file" > "docs/specs/$file"
78+
done
79+
for file in $(git ls-tree --name-only master:electrical/ 2>/dev/null | grep -E "\.$ext$" || true); do
80+
git show "master:electrical/$file" > "docs/specs/$file"
81+
done
82+
done
83+
84+
# Stage all changes
85+
git add -A
86+
87+
# Commit and push if there are changes
88+
if git diff --staged --quiet; then
89+
echo "No changes to commit"
90+
echo "CHANGES_MADE=false" >> $GITHUB_ENV
91+
else
92+
git commit -m "Sync markdown files from master"
93+
git push origin site
94+
echo "CHANGES_MADE=true" >> $GITHUB_ENV
95+
fi
96+
97+
- name: Trigger deploy workflow
98+
if: env.CHANGES_MADE == 'true'
99+
run: |
100+
gh workflow run deploy.yml --ref site
101+
env:
102+
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
site/
2+
.venv/
3+
venv/
4+
__pycache__/
5+
*.pyc
6+
.DS_Store

0 commit comments

Comments
 (0)