Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/slv-remote-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
17 changes: 2 additions & 15 deletions ansible/compile-slv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
29 changes: 0 additions & 29 deletions scripts/create-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 .`)
Expand Down