This repository was archived by the owner on Aug 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
74 lines (74 loc) · 2.63 KB
/
action.yml
File metadata and controls
74 lines (74 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: 'BitCraft Bindings'
description: 'Fetches BitCraft module wasm from STDB and generates client bindings.'
inputs:
data-dir:
required: true
description: Root directory to put files in
bitcraft-spacetime-host:
required: true
description: Hostname of bitcraft-global module
stdb-cli-version:
required: true
description: Ref for STDB repo to build a dev version of CLI
stdb-auth:
required: false
description: Auth header value, anonymous if not provided
outputs:
updated_bindings:
description: true if something was updated
value: ${{ steps.gen-bindings.outputs.updated_bindings }}
program_hash:
description: hash of latest module version bindings were generated for
value: $${{ steps.gen-bindings.outputs.program_hash }}
runs:
using: "composite"
steps:
## switch back to mainline when they release TS binding fixes?
## also will need to test how this installer even works in an action
#- run: curl -sSf https://install.spacetimedb.com | sh
# shell: bash
- uses: actions/cache@v3
id: cache-stdb
with:
key: '${{ inputs.stdb-cli-version }}'
path: '${{ github.workspace }}/stdb'
- if: ${{ steps.cache-stdb.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
repository: ClockworkLabs/SpacetimeDB
ref: ${{ inputs.stdb-cli-version }}
path: '${{ github.workspace }}/stdb'
- if: ${{ steps.cache-stdb.outputs.cache-hit != 'true' }}
uses: Swatinem/rust-cache@v2
with:
workspaces: |
stdb -> target
cache-on-failure: true
- if: ${{ steps.cache-stdb.outputs.cache-hit != 'true' }}
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- if: ${{ steps.cache-stdb.outputs.cache-hit != 'true' }}
run: |
cd ${{ github.workspace }}/stdb
cargo build --release
mkdir bin
cp target/release/spacetimedb-standalone bin/spacetimedb-standalone
cp target/release/spacetimedb-cli bin/spacetime
shell: bash
- run: echo ${{ github.workspace }}/stdb/bin >> "$GITHUB_PATH"
shell: bash
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- run: rm -rf "${{ inputs.data-dir }}"/{cs,ts,rs}
shell: bash
- id: gen-bindings
run: python ${{ github.action_path }}/bindings.py
shell: bash
env:
DATA_DIR: ${{ inputs.data-dir }}
BITCRAFT_SPACETIME_HOST: ${{ inputs.bitcraft-spacetime-host }}
BITCRAFT_SPACETIME_AUTH: ${{ inputs.stdb-auth }}