Skip to content

Commit 052d17c

Browse files
Miriadclaudebinoy14
authored andcommitted
chore: replace release-please with changesets
Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Binoy Patel <6476108+binoy14@users.noreply.github.com>
1 parent ce4da6b commit 052d17c

File tree

11 files changed

+867
-201
lines changed

11 files changed

+867
-201
lines changed

.changeset/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that
4+
works with multi-package repos, or single-package repos to help you version and publish your code. You
5+
can find the full documentation for it [in the changesets repo](https://github.com/changesets/changesets).
6+
7+
## Adding a changeset
8+
9+
When making changes that should be released, run:
10+
11+
```bash
12+
pnpm changeset
13+
```
14+
15+
This will guide you through creating a changeset file that describes your changes.
16+
17+
## What is a changeset?
18+
19+
A changeset is a piece of information about changes made in a branch or commit. It holds three bits of information:
20+
21+
- What packages need to be released
22+
- What semver bump type each package should have (major/minor/patch)
23+
- A summary of the changes (used in changelogs)

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "sanity-io/cli"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "public",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Add changeset from conventional commits
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize]
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions:
10+
contents: write # for pushing changeset files to PR branch
11+
pull-requests: write
12+
13+
jobs:
14+
changeset:
15+
runs-on: ubuntu-latest
16+
# Only run for PRs from bots (renovate, dependabot) or when commits follow conventional format
17+
if: >-
18+
github.event.pull_request.user.login == 'renovate[bot]' ||
19+
github.event.pull_request.user.login == 'dependabot[bot]'
20+
steps:
21+
- name: Generate GitHub App Token
22+
id: generate_token
23+
uses: actions/create-github-app-token@v2
24+
with:
25+
app-id: ${{ secrets.ECOSPARK_APP_ID }}
26+
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
27+
28+
- name: Generate changeset from conventional commits
29+
uses: mscharley/dependency-changesets-action@e704c89dbc4e284d055aa520308291690f645a4f # v1.2.2
30+
with:
31+
token: ${{ steps.generate_token.outputs.token }}
32+
use-conventional-commits: true
33+
sign-commits: true

.github/workflows/release-please.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: write # for version bump commits and tags
14+
pull-requests: write # for creating Version Packages PR
15+
id-token: write # to enable use of OIDC for npm provenance
16+
17+
jobs:
18+
release:
19+
name: Release
20+
runs-on: ubuntu-latest
21+
outputs:
22+
published: ${{ steps.changesets.outputs.published }}
23+
24+
env:
25+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
26+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
27+
28+
steps:
29+
- name: Generate GitHub App Token
30+
id: generate_token
31+
uses: actions/create-github-app-token@v2
32+
with:
33+
app-id: ${{ secrets.ECOSPARK_APP_ID }}
34+
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
35+
36+
- name: Checkout
37+
uses: actions/checkout@v6
38+
with:
39+
fetch-depth: 0
40+
token: ${{ steps.generate_token.outputs.token }}
41+
persist-credentials: false
42+
43+
- name: Setup Environment
44+
uses: ./.github/actions/setup
45+
with:
46+
node-version: 20
47+
48+
- name: Build packages
49+
run: pnpm run build:cli
50+
51+
- name: Create Release Pull Request or Publish
52+
id: changesets
53+
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
54+
with:
55+
version: pnpm version-packages
56+
publish: pnpm publish-packages
57+
title: 'chore: version packages'
58+
commit: 'chore: version packages'
59+
createGithubReleases: true
60+
env:
61+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
63+
NPM_CONFIG_PROVENANCE: true
64+
65+
- name: Summary
66+
if: ${{ steps.changesets.outputs.published == 'true' }}
67+
env:
68+
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
69+
run: |
70+
echo "## Published Packages 🚀" >> $GITHUB_STEP_SUMMARY
71+
echo "" >> $GITHUB_STEP_SUMMARY
72+
echo "Published packages:" >> $GITHUB_STEP_SUMMARY
73+
echo '```json' >> $GITHUB_STEP_SUMMARY
74+
echo "$PUBLISHED_PACKAGES" >> $GITHUB_STEP_SUMMARY
75+
echo '```' >> $GITHUB_STEP_SUMMARY
76+
77+
post-release:
78+
runs-on: ubuntu-latest
79+
needs: release
80+
if: ${{ needs.release.outputs.published == 'true' }}
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@v6
84+
85+
- name: Mark SDK issues as done
86+
uses: sanity-io/mark-issues-done-action@88e6a3e6bc5a9c86d45873c4dba3302a4cafcb65 # main
87+
with:
88+
linear_api_key: ${{ secrets.LINEAR_API_KEY }}
89+
repository_name: ${{ github.event.repository.name }}
90+
initial_state_id: 'c56956cd-c281-4ca5-889f-6189ce231a6d'
91+
done_state_id: '5a35b7bf-6d37-4cc2-854a-2f18d160e2e5'

0 commit comments

Comments
 (0)