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
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Request review from the default repository maintainer.
* @pei-tinybird
# Pull requests need a review from the RawTree engineering team.
* @rawtreedb/engineering
48 changes: 48 additions & 0 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release SDK

# Publishes @rawtree/analytics to npm when a tag like `analytics-v0.1.0` is pushed.
# The tag must match packages/analytics/package.json. Auth uses npm trusted publishing
# (OIDC, no stored token) once it's configured for this workflow on npmjs.com; an
# NPM_TOKEN repository secret works as a fallback.

on:
push:
tags: ["analytics-v*"]

permissions:
contents: read
id-token: write # npm trusted publishing and provenance

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org

- name: Use an npm that supports trusted publishing
run: npm install -g npm@^11.5.1

- name: Check the tag matches the package version
run: |
expected="analytics-v$(node -p 'require("./packages/analytics/package.json").version')"
if [ "$GITHUB_REF_NAME" != "$expected" ]; then
echo "Tag $GITHUB_REF_NAME does not match $expected" >&2
exit 1
fi

- name: Install dependencies
run: npm ci

- name: Test
run: npm test

- name: Publish
run: npm publish -w @rawtree/analytics --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ CI runs the same three checks on every pull request. Every pull request also get

[AGENTS.md](AGENTS.md) has the same rules in more detail, for people and coding agents.

## Releasing the SDK (maintainers)

`@rawtree/analytics` is published to npm by the [Release SDK](.github/workflows/release-sdk.yml) workflow, with provenance.

1. Bump `version` in `packages/analytics/package.json` in a pull request (semver: breaking changes to the event contract or the public API need a major version once we're past 0.x) and merge it.
2. Tag the merge commit and push the tag: `git tag analytics-v0.2.0 && git push origin analytics-v0.2.0`.
3. The workflow checks that the tag matches the version, runs the tests, and publishes.

One-time setup: an npm account with publish rights on the `@rawtree` scope, and on npmjs.com a trusted publisher for this repository and the `release-sdk.yml` workflow (or an `NPM_TOKEN` repository secret). Provenance requires the repository to be public.

## License

By contributing, you agree that your contributions are licensed under the [Apache License 2.0](LICENSE).
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Security policy

## Reporting a vulnerability

Please don't open a public issue for security problems. Report them privately through GitHub: on this repository's **Security** tab, choose **Report a vulnerability**. We'll acknowledge the report and keep you updated while we fix it.

Include what's affected (the SDK, the collector, the dashboard, sign-in, or the console), how to reproduce it, and the impact you see. Never include real API keys, tokens, or other people's data.

## Supported versions

Security fixes go into the latest release of `@rawtree/analytics` and the `main` branch.
Loading