From 76d3d08f9d0525bce70fcf384f5bfa944fd8aaee Mon Sep 17 00:00:00 2001 From: Tim Docker Date: Fri, 22 Nov 2024 17:57:21 +1100 Subject: [PATCH] setup github actions to publish ts runtime to jsr --- .github/workflows/publish-ts-runtime.yaml | 17 +++++++++++++++++ typescript/runtime/embedded/utils.ts | 7 +++++++ typescript/runtime/published/deno.json | 2 +- typescript/runtime/published/src/utils.ts | 7 +++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-ts-runtime.yaml diff --git a/.github/workflows/publish-ts-runtime.yaml b/.github/workflows/publish-ts-runtime.yaml new file mode 100644 index 00000000..41f941b3 --- /dev/null +++ b/.github/workflows/publish-ts-runtime.yaml @@ -0,0 +1,17 @@ + +name: Publish + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # The OIDC ID token is used for authentication with JSR. + steps: + - uses: actions/checkout@v4 + - run: npx jsr publish diff --git a/typescript/runtime/embedded/utils.ts b/typescript/runtime/embedded/utils.ts index b358aee7..8e654067 100644 --- a/typescript/runtime/embedded/utils.ts +++ b/typescript/runtime/embedded/utils.ts @@ -46,6 +46,13 @@ export function scopedNamesEqual(sn1: AST.ScopedName, sn2: AST.ScopedName): bool return sn1.moduleName === sn2.moduleName && sn1.name === sn2.name; } +export function scopedName( + moduleName: string, + name: string, +): AST.ScopedName { + return { moduleName, name }; +} + function typeExprToStringImpl(te: AST.TypeExpr, withScopedNames: boolean) : string { let result = ""; if (te.typeRef.kind == "primitive") { diff --git a/typescript/runtime/published/deno.json b/typescript/runtime/published/deno.json index 3d2cdd2b..55c645a3 100644 --- a/typescript/runtime/published/deno.json +++ b/typescript/runtime/published/deno.json @@ -1,6 +1,6 @@ { "name": "@adllang/adl-runtime", - "version": "0.0.2", + "version": "0.1.0", "license": "BSD", "exports": "./src/mod.ts", "imports": { diff --git a/typescript/runtime/published/src/utils.ts b/typescript/runtime/published/src/utils.ts index 1375c45b..b8d329dd 100644 --- a/typescript/runtime/published/src/utils.ts +++ b/typescript/runtime/published/src/utils.ts @@ -46,6 +46,13 @@ export function scopedNamesEqual(sn1: AST.ScopedName, sn2: AST.ScopedName): bool return sn1.moduleName === sn2.moduleName && sn1.name === sn2.name; } +export function scopedName( + moduleName: string, + name: string, +): AST.ScopedName { + return { moduleName, name }; +} + function typeExprToStringImpl(te: AST.TypeExpr, withScopedNames: boolean) : string { let result = ""; if (te.typeRef.kind == "primitive") {