



























@@ -0,0 +1,188 @@
1+name: Website Installer Sync
2+3+on:
4+pull_request:
5+paths:
6+ - scripts/install.sh
7+ - scripts/install-cli.sh
8+ - scripts/install.ps1
9+ - scripts/install.cmd
10+ - .github/workflows/website-installer-sync.yml
11+push:
12+branches: [main]
13+paths:
14+ - scripts/install.sh
15+ - scripts/install-cli.sh
16+ - scripts/install.ps1
17+ - scripts/install.cmd
18+ - .github/workflows/website-installer-sync.yml
19+workflow_dispatch:
20+inputs:
21+sync_website:
22+description: Sync openclaw.ai after verification
23+required: false
24+default: false
25+type: boolean
26+27+permissions:
28+contents: read
29+30+concurrency:
31+group: website-installer-sync-${{ github.event_name == 'workflow_dispatch' && github.run_id || github.ref }}
32+cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }}
33+34+env:
35+FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
36+37+jobs:
38+static:
39+runs-on: ubuntu-24.04
40+steps:
41+ - name: Checkout
42+uses: actions/checkout@v6
43+44+ - name: Install ShellCheck
45+run: sudo apt-get update -y && sudo apt-get install -y shellcheck
46+47+ - name: Shell syntax
48+run: bash -n scripts/install.sh scripts/install-cli.sh
49+50+ - name: ShellCheck
51+run: shellcheck -e SC1091 scripts/install.sh scripts/install-cli.sh
52+53+ - name: Installer help and dry-runs
54+run: |
55+ bash scripts/install.sh --help >/tmp/install-help.txt
56+ bash scripts/install.sh --dry-run --no-onboard --no-prompt
57+ bash scripts/install-cli.sh --help >/tmp/install-cli-help.txt
58+59+ - name: PowerShell syntax
60+shell: pwsh
61+run: |
62+ $errors = $null
63+ $null = [System.Management.Automation.PSParser]::Tokenize(
64+ (Get-Content -Raw scripts/install.ps1),
65+ [ref]$errors
66+ )
67+ if ($errors -and $errors.Count -gt 0) {
68+ $errors | Format-List | Out-String | Write-Error
69+ exit 1
70+ }
71+72+ linux-docker:
73+runs-on: ubuntu-24.04
74+steps:
75+ - name: Checkout
76+uses: actions/checkout@v6
77+78+ - name: install.sh in Docker
79+run: |
80+ docker run --rm \
81+ -e OPENCLAW_NO_ONBOARD=1 \
82+ -e OPENCLAW_NO_PROMPT=1 \
83+ -v "$PWD/scripts/install.sh:/tmp/install.sh:ro" \
84+ node:24-bookworm-slim \
85+ bash -lc 'bash /tmp/install.sh --no-prompt --no-onboard --version latest && openclaw --version'
86+87+ - name: install-cli.sh in Docker
88+run: |
89+ docker run --rm \
90+ -e OPENCLAW_NO_ONBOARD=1 \
91+ -e OPENCLAW_NO_PROMPT=1 \
92+ -v "$PWD/scripts/install-cli.sh:/tmp/install-cli.sh:ro" \
93+ node:24-bookworm-slim \
94+ bash -lc 'apt-get update -y && apt-get install -y curl && bash /tmp/install-cli.sh --prefix /tmp/openclaw --no-onboard --version latest && /tmp/openclaw/bin/openclaw --version'
95+96+ macos-installer:
97+runs-on: macos-latest
98+steps:
99+ - name: Checkout
100+uses: actions/checkout@v6
101+102+ - name: install.sh dry run
103+run: bash scripts/install.sh --dry-run --no-onboard --no-prompt
104+105+windows-installer:
106+runs-on: windows-latest
107+steps:
108+ - name: Checkout
109+uses: actions/checkout@v6
110+111+ - name: Setup Node.js
112+uses: actions/setup-node@v6
113+with:
114+node-version: 24
115+116+ - name: install.ps1 dry run
117+shell: pwsh
118+run: .\scripts\install.ps1 -DryRun -NoOnboard -InstallMethod npm
119+120+ - name: install.cmd dry run
121+shell: cmd
122+run: set "OPENCLAW_INSTALL_PS1_URL=%GITHUB_WORKSPACE%\scripts\install.ps1" && .\scripts\install.cmd --dry-run --no-onboard --npm
123+124+sync-website:
125+needs: [static, linux-docker, macos-installer, windows-installer]
126+if: >
127+ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
128+ (github.event_name == 'workflow_dispatch' && inputs.sync_website)
129+ runs-on: ubuntu-24.04
130+steps:
131+ - name: Checkout OpenClaw
132+uses: actions/checkout@v6
133+with:
134+path: openclaw
135+136+ - name: Checkout openclaw.ai
137+uses: actions/checkout@v6
138+with:
139+repository: openclaw/openclaw.ai
140+token: ${{ secrets.OPENCLAW_GH_TOKEN }}
141+path: openclaw.ai
142+143+ - name: Sync installer scripts
144+run: |
145+ cp openclaw/scripts/install.sh openclaw.ai/public/install.sh
146+ cp openclaw/scripts/install-cli.sh openclaw.ai/public/install-cli.sh
147+ cp openclaw/scripts/install.ps1 openclaw.ai/public/install.ps1
148+ cp openclaw/scripts/install.cmd openclaw.ai/public/install.cmd
149+ chmod +x openclaw.ai/public/install.sh openclaw.ai/public/install-cli.sh
150+151+ - name: Check for changes
152+id: changes
153+working-directory: openclaw.ai
154+run: |
155+ if git diff --quiet -- public/install.sh public/install-cli.sh public/install.ps1 public/install.cmd; then
156+ echo "changed=false" >> "$GITHUB_OUTPUT"
157+ else
158+ echo "changed=true" >> "$GITHUB_OUTPUT"
159+ fi
160+161+ - name: Setup Bun
162+if: steps.changes.outputs.changed == 'true'
163+uses: oven-sh/setup-bun@v2
164+with:
165+bun-version: latest
166+167+ - name: Install ShellCheck
168+if: steps.changes.outputs.changed == 'true'
169+run: sudo apt-get update -y && sudo apt-get install -y shellcheck
170+171+ - name: Verify website with synced installers
172+if: steps.changes.outputs.changed == 'true'
173+working-directory: openclaw.ai
174+run: |
175+ bash -n public/install.sh public/install-cli.sh
176+ shellcheck -e SC1091 public/install.sh public/install-cli.sh
177+ bun install --frozen-lockfile
178+ bun run build
179+180+ - name: Commit and push website sync
181+if: steps.changes.outputs.changed == 'true'
182+working-directory: openclaw.ai
183+run: |
184+ git config user.name "openclaw-installer-sync[bot]"
185+ git config user.email "openclaw-installer-sync[bot]@users.noreply.github.com"
186+ git add public/install.sh public/install-cli.sh public/install.ps1 public/install.cmd
187+ git commit -m "chore: sync installers from openclaw ${GITHUB_SHA::12}"
188+ git push origin HEAD:main
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。