Skip to content

Commit b8feb32

Browse files
committed
feat(go): creating remote package for reusable bindings
Signed-off-by: Andrew Steurer <[email protected]>
1 parent 88533c1 commit b8feb32

File tree

31 files changed

+158
-113
lines changed

31 files changed

+158
-113
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ jobs:
5959
EOF
6060
if: steps.tag.outputs.push_tag == 'yes'
6161

62+
- name: Push Go package tag
63+
run: |
64+
git_refs_url=$(jq .repository.git_refs_url $GITHUB_EVENT_PATH | tr -d '"' | sed 's/{\/sha}//g')
65+
curl -iX POST $git_refs_url \
66+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
67+
-d @- << EOF
68+
{
69+
"ref": "refs/tags/crates/go/src/package/v${{ steps.tag.outputs.version }}",
70+
"sha": "${{ steps.tag.outputs.sha }}"
71+
}
72+
EOF
73+
if: steps.tag.outputs.push_tag == 'yes'
74+
75+
6276
- run: |
6377
sha=${{ github.sha }}
6478
run_id=$(

crates/go/src/lib.rs

Lines changed: 62 additions & 84 deletions
Large diffs are not rendered by default.

crates/go/src/package/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/bytecodealliance/wit-bindgen
2+
3+
go 1.25.5

crates/go/src/wit_async.go renamed to crates/go/src/package/wit_async/wit_async.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import (
44
"fmt"
55
"runtime"
66
"unsafe"
7-
"wit_component/wit_runtime"
7+
8+
"github.com/bytecodealliance/wit-bindgen/wit_runtime"
89
)
910

1011
const EVENT_NONE uint32 = 0
File renamed without changes.

crates/go/src/wit_future.go renamed to crates/go/src/package/wit_types/wit_future.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package wit_types
33
import (
44
"runtime"
55
"unsafe"
6-
"wit_component/wit_async"
7-
"wit_component/wit_runtime"
6+
7+
"github.com/bytecodealliance/wit-bindgen/wit_async"
8+
"github.com/bytecodealliance/wit-bindgen/wit_runtime"
89
)
910

1011
type FutureVtable[T any] struct {
File renamed without changes.
File renamed without changes.

crates/go/src/wit_stream.go renamed to crates/go/src/package/wit_types/wit_stream.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package wit_types
33
import (
44
"runtime"
55
"unsafe"
6-
"wit_component/wit_async"
7-
"wit_component/wit_runtime"
6+
7+
"github.com/bytecodealliance/wit-bindgen/wit_async"
8+
"github.com/bytecodealliance/wit-bindgen/wit_runtime"
89
)
910

1011
type StreamVtable[T any] struct {
File renamed without changes.

0 commit comments

Comments
 (0)