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
40 changes: 40 additions & 0 deletions .github/workflows/reusable-release-sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0

name: Release SDK

on:
workflow_dispatch:

permissions:
contents: read
id-token: write # Required for npm OIDC trusted publishing

jobs:
javascript:
name: JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install Task
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 #v2.0.0

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24.x"
registry-url: https://registry.npmjs.org/
scope: "@agntcy"

- name: Build the Javascript package
run: |
task sdk:deps:javascript
task sdk:build:javascript

- name: Publish the Javascript SDK
run: |
task sdk:release:javascript
11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,14 @@ tasks:
#cd {{ .ROOT_DIR }}/sdk/examples/example-js
#npm install
#npm run example

sdk:release:javascript:
desc: Release javascript client SDK package
cmd: |
version=$(npm pkg get version)

if [[ $version == *"rc"* ]]; then
npm publish --scope=@agntcy --access public --tag rc-{{.COMMIT_SHA}}
else
npm publish --scope=@agntcy --access public
fi
Loading