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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use bun for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general this is a bun repo - so no package lock


# Disabled until generated src/index.ts is synced with src/sdk.ts exports
# on:
# pull_request:
# branches: [main]
# push:
# branches: [main]
on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run type-check
- run: bun run build
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

# Disabled until generated src/index.ts is synced with src/sdk.ts exports
# on:
# push:
# branches: [main]
# paths:
# - 'src/**'
# - 'package.json'
# - 'tsconfig.json'
on: workflow_dispatch

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'

- name: Check if version is already published
id: version-check
run: |
LOCAL_VERSION=$(node -p "require('./package.json').version")
PKG_NAME=$(node -p "require('./package.json').name")
PUBLISHED_VERSION=$(npm view "${PKG_NAME}" version 2>/dev/null || echo "0.0.0")
echo "local=${LOCAL_VERSION}" >> "$GITHUB_OUTPUT"
echo "published=${PUBLISHED_VERSION}" >> "$GITHUB_OUTPUT"
if [ "${LOCAL_VERSION}" = "${PUBLISHED_VERSION}" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "Version ${LOCAL_VERSION} is already published — skipping."
else
echo "skip=false" >> "$GITHUB_OUTPUT"
echo "Publishing ${PKG_NAME}@${LOCAL_VERSION} (current: ${PUBLISHED_VERSION})"
fi

- run: bun install
if: steps.version-check.outputs.skip == 'false'

- run: bun run type-check
if: steps.version-check.outputs.skip == 'false'

- run: bun run build
if: steps.version-check.outputs.skip == 'false'

- run: npm publish --provenance --access public
if: steps.version-check.outputs.skip == 'false'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
*.tgz
.env
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
Loading