Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bfops/merge-master
Browse files Browse the repository at this point in the history
  • Loading branch information
bfops committed Sep 9, 2024
2 parents 9904a02 + d46057c commit 4a4ca20
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/check-pr-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Git tree checks

on:
pull_request:
types: [opened, edited, reopened, synchronize]
merge_group:
permissions: read-all

jobs:
check_base_ref:
name: Only release branches may merge into master
runs-on: ubuntu-latest
steps:
- id: not_based_on_master
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'master' &&
! startsWith(github.event.pull_request.head.ref, 'release/')
run: |
echo 'Only `release/*` branches are allowed to merge into `master`.'
echo 'Maybe your PR should be merging into `staging`?'
exit 1
4 changes: 2 additions & 2 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

## `SpacetimeDB.ClientApi`

To regenerate this namespace, run the `tools/gen-client-api.sh` or the
`tools/gen-client-api.bat` script.
To regenerate this namespace, run the `tools~/gen-client-api.sh` or the
`tools~/gen-client-api.bat` script.
20 changes: 20 additions & 0 deletions tools~/gen-client-api.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off
setlocal

if "%CL_HOME%"=="" (
echo "Variable CL_HOME not set"
exit /b 1
)

cd %CL_HOME%\SpacetimeDB\crates\client-api-messages
cargo run --example get_ws_schema > %CL_HOME%/schema.json

cd %CL_HOME%\SpacetimeDB\crates\cli
cargo run -- generate -l csharp -n SpacetimeDB.ClientApi ^
--json-module %CL_HOME%\schema.json ^
-o %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi

cd %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi
del /q _Globals

del %CL_HOME%\schema.json
15 changes: 15 additions & 0 deletions tools~/gen-client-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -eu
: $CL_HOME

cd $CL_HOME/SpacetimeDB/crates/client-api-messages
cargo run --example get_ws_schema > $CL_HOME/schema.json

cd $CL_HOME/SpacetimeDB/crates/cli
cargo run -- generate -l csharp -n SpacetimeDB.ClientApi \
--json-module $CL_HOME/schema.json \
-o $CL_HOME/spacetimedb-csharp-sdk/src/SpacetimeDB/ClientApi

cd $CL_HOME/spacetimedb-csharp-sdk/src/SpacetimeDB/ClientApi
rm -rf _Globals

rm -f $CL_HOME/schema.json

0 comments on commit 4a4ca20

Please sign in to comment.