-
Notifications
You must be signed in to change notification settings - Fork 0
Implement npm release flow based on SDK reference #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9fd6ad2
feat: add foundation files (.gitignore, .npmrc, package.json scripts)
github-actions[bot] 5697ac7
ci: add GitHub Actions CI workflow for PR checks
github-actions[bot] 9d04f0d
ci: add GitHub Actions release workflow for npm publishing
github-actions[bot] 6ad7718
fix: harden CI/CD workflows and fix SDK export name mismatches
github-actions[bot] 354ecc1
fix(ci): add package-lock.json for npm cache in GitHub Actions
github-actions[bot] 6831f29
fix: switch CI/release to bun, revert generated code, disable workflows
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: CI | ||
|
|
||
| # 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| node_modules/ | ||
| dist/ | ||
| *.tgz | ||
| .env | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| registry=https://registry.npmjs.org/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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