From e2c0d84c644cc6e8d3ac02f617d54b2fb93bc6ce Mon Sep 17 00:00:00 2001 From: Sephiroth Date: Tue, 24 Feb 2026 15:59:26 +0000 Subject: [PATCH] improve release: mac Actions build + clawhub skills publish - Add macOS build job (macos-latest) to GitHub Actions workflow - Remove local macOS build requirement from create-release.ts - Update ansible/compile-slv.yml to use Actions artifact instead of local release-assets - Add clawhub skills publish step for validator, rpc, grpc-geyser --- .github/workflows/slv-remote-build.yml | 67 ++++++++++++++++++++++++++ ansible/compile-slv.yml | 17 +------ scripts/create-release.ts | 29 ----------- 3 files changed, 69 insertions(+), 44 deletions(-) diff --git a/.github/workflows/slv-remote-build.yml b/.github/workflows/slv-remote-build.yml index 903a935..99df788 100644 --- a/.github/workflows/slv-remote-build.yml +++ b/.github/workflows/slv-remote-build.yml @@ -15,6 +15,41 @@ on: default: "0.6.0" jobs: + build-mac: + name: Build macOS Binary + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Ensure api/slv-api/deno.json exists + run: | + if [ ! -f api/slv-api/deno.json ]; then + mkdir -p api/slv-api + printf '{\n}\n' > api/slv-api/deno.json + fi + + - name: Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v2.6.5 + + - name: Build macOS executable + run: | + deno install --allow-scripts=npm:protobufjs@7.4.0 + deno i + deno task build:mac + + - name: Upload macOS artifact + uses: actions/upload-artifact@v4 + with: + name: slv-macos-binary + path: dist/slv-x86_64-apple-darwin-exe.tar.gz + retention-days: 1 + test: name: Run Tests runs-on: [self-hosted, runner-slv-1] @@ -74,6 +109,7 @@ jobs: name: Remote Build and Release needs: - test + - build-mac if: success() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') runs-on: [self-hosted] permissions: @@ -132,6 +168,12 @@ jobs: - name: Create artifacts directory run: mkdir -p artifacts dist renamed_files + - name: Download macOS artifact from build-mac job + uses: actions/download-artifact@v4 + with: + name: slv-macos-binary + path: dist/ + - name: Compile SLV on remote server run: | ansible-playbook -i 'localhost,' -u solv -c local ansible/compile-slv.yml \ @@ -185,3 +227,28 @@ jobs: - See commit history for details token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build OpenClaw skills + run: | + for skill in validator rpc grpc-geyser; do + bash build-skill.sh "$skill" "${{ env.VERSION }}" + done + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Install clawhub CLI and publish skills + env: + CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} + run: | + npm i -g clawhub + for skill_dir in oss-skills/slv-validator oss-skills/slv-rpc oss-skills/slv-grpc-geyser; do + if [ -d "$skill_dir" ]; then + echo "Publishing $skill_dir..." + clawhub publish "$skill_dir" --version "${{ env.VERSION }}" + else + echo "Warning: $skill_dir not found, skipping" + fi + done diff --git a/ansible/compile-slv.yml b/ansible/compile-slv.yml index e29cca2..dbafe03 100644 --- a/ansible/compile-slv.yml +++ b/ansible/compile-slv.yml @@ -159,22 +159,9 @@ environment: "{{ deno_env }}" become_user: '{{ build_user }}' - - name: Check macOS artifact from local release - stat: - path: '{{ build_dir }}/release-assets/{{ version }}/slv-x86_64-apple-darwin-exe.tar.gz' - register: mac_artifact_stat - become_user: '{{ build_user }}' - - - name: Fail if macOS artifact is missing - fail: - msg: >- - Missing macOS artifact at {{ build_dir }}/release-assets/{{ version }}/slv-x86_64-apple-darwin-exe.tar.gz. - Run create-release.ts on macOS before tagging. - when: not mac_artifact_stat.stat.exists - - - name: Stage macOS artifact into dist + - name: Copy macOS artifact from Actions into build dist copy: - src: '{{ build_dir }}/release-assets/{{ version }}/slv-x86_64-apple-darwin-exe.tar.gz' + src: '{{ playbook_dir }}/../dist/slv-x86_64-apple-darwin-exe.tar.gz' dest: '{{ build_dir }}/dist/slv-x86_64-apple-darwin-exe.tar.gz' remote_src: yes owner: '{{ build_user }}' diff --git a/scripts/create-release.ts b/scripts/create-release.ts index f005c06..d52c7a7 100644 --- a/scripts/create-release.ts +++ b/scripts/create-release.ts @@ -62,35 +62,6 @@ async function createRelease() { const updateResult = await spawnSync('deno run -A scripts/update-version.ts') console.log(updateResult.message) - // 2.5 Build macOS executable locally and stage it for remote upload - if (Deno.build.os !== 'darwin') { - console.error('Error: create-release must be run on macOS for mac builds.') - Deno.exit(1) - } - const releaseAssetsRoot = './release-assets' - try { - await Deno.remove(releaseAssetsRoot, { recursive: true }) - } catch (error) { - if (!(error instanceof Deno.errors.NotFound)) { - throw error - } - } - console.log('Building macOS executable locally...') - await Deno.mkdir('./dist', { recursive: true }) - const buildMacResult = await spawnSync('deno task build:mac') - if (!buildMacResult.success) { - console.error('❌ Failed to build macOS executable.') - Deno.exit(1) - } - console.log(buildMacResult.message) - const macTarPath = './dist/slv-x86_64-apple-darwin-exe.tar.gz' - const releaseAssetsDir = `${releaseAssetsRoot}/${newVersion}` - await Deno.mkdir(releaseAssetsDir, { recursive: true }) - const macReleasePath = - `${releaseAssetsDir}/slv-x86_64-apple-darwin-exe.tar.gz` - await Deno.copyFile(macTarPath, macReleasePath) - console.log(`✅ Staged macOS artifact at ${macReleasePath}`) - // 3. Commit the changes console.log('Committing changes...') await spawnSync(`git add .`)