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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "plotday/plot" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@plotday/agent-*"]
}
8 changes: 8 additions & 0 deletions .changeset/goofy-groups-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@plotday/tool-outlook-calendar": patch
"@plotday/tool-google-calendar": patch
"@plotday/tool-google-contacts": patch
"@plotday/sdk": patch
---

Initial automated release setup
5 changes: 5 additions & 0 deletions .changeset/shiny-wolves-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@plotday/sdk": minor
---

Add README.md and AGENTS.md on "plot agent create"
67 changes: 67 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Changeset Check

on:
pull_request:
branches:
- main

jobs:
check:
name: Check for changeset
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check if SDK or tools were modified
id: check-changes
run: |
# Get list of changed files
git fetch origin main
CHANGED_FILES=$(git diff --name-only origin/main...HEAD)

# Check if SDK or tools directories were modified
SDK_CHANGED=$(echo "$CHANGED_FILES" | grep -E '^sdk/' || true)
TOOLS_CHANGED=$(echo "$CHANGED_FILES" | grep -E '^tools/' || true)

if [ -n "$SDK_CHANGED" ] || [ -n "$TOOLS_CHANGED" ]; then
echo "needs-changeset=true" >> $GITHUB_OUTPUT
echo "SDK or tools packages were modified"
else
echo "needs-changeset=false" >> $GITHUB_OUTPUT
echo "No SDK or tools changes detected"
fi

- name: Check for changesets
if: steps.check-changes.outputs.needs-changeset == 'true'
run: |
# Check if there are any changeset files (excluding README.md and config.json)
CHANGESET_COUNT=$(ls -1 .changeset/*.md 2>/dev/null | grep -v README.md | wc -l | tr -d ' ')

if [ "$CHANGESET_COUNT" -eq 0 ]; then
echo "❌ Error: Changes detected in SDK or tools packages, but no changeset found."
echo ""
echo "Please add a changeset by running:"
echo " pnpm changeset"
echo ""
echo "This helps maintain proper versioning and changelogs."
exit 1
else
echo "✅ Changeset found (count: $CHANGESET_COUNT)"
fi
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm version-packages
publish: pnpm release
commit: 'chore: version packages'
title: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Releases
if: steps.changesets.outputs.published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Parse published packages and create releases for each
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -c '.[]' | while read -r package; do
name=$(echo "$package" | jq -r '.name')
version=$(echo "$package" | jq -r '.version')

# Determine package directory
if [[ "$name" == "@plotday/sdk" ]]; then
pkg_dir="sdk"
elif [[ "$name" == @plotday/tool-* ]]; then
tool_name="${name#@plotday/tool-}"
pkg_dir="tools/$tool_name"
else
echo "Unknown package: $name"
continue
fi

# Create tag name (e.g., sdk@0.9.1 or tool-google-calendar@0.1.0)
tag_name="${pkg_dir//\//@}@${version}"

# Extract changelog entry for this version
changelog_file="$pkg_dir/CHANGELOG.md"
if [ -f "$changelog_file" ]; then
# Extract the section for this version from CHANGELOG
release_notes=$(awk "/## ${version}/,/## [0-9]/" "$changelog_file" | sed '1d;$d' | sed '/^$/d')

if [ -z "$release_notes" ]; then
release_notes="Release ${name}@${version}"
fi
else
release_notes="Release ${name}@${version}"
fi

# Create GitHub release
echo "Creating release for $name@$version with tag $tag_name"
gh release create "$tag_name" \
--title "${name}@${version}" \
--notes "$release_notes" \
--verify-tag || echo "Release creation failed for $tag_name, may already exist"
done

- name: Summary
if: steps.changesets.outputs.published == 'true'
run: |
echo "### 🚀 Published Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The following packages were published to npm:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | "- **\(.name)@\(.version)** ([GitHub Release](https://github.com/${{ github.repository }}/releases/tag/\(.name | gsub("@plotday/"; "") | gsub("/"; "@"))@\(.version)))"' >> $GITHUB_STEP_SUMMARY
Loading