Skip to content

Commit 14defdb

Browse files
committed
chore: configure changesets and add release workflow
1 parent e2cc2e0 commit 14defdb

File tree

7 files changed

+913
-3
lines changed

7 files changed

+913
-3
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": true,
5+
"access": "public",
6+
"baseBranch": "main",
7+
"updateInternalDependencies": "patch",
8+
"ignore": []
9+
}

.changeset/young-squids-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"diff-hound": patch
3+
---
4+
5+
chore: configure changesets and add release workflow

.github/workflows/changeset-lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Changeset Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
name: Check for Changeset
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- run: npm ci
21+
22+
- run: npx changeset status --since=origin/main

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 🚀 Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Version & Publish
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: write
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 20
25+
registry-url: "https://registry.npmjs.org/"
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Version packages with Changesets
34+
run: npx changeset version
35+
36+
- name: Commit version bump and changelog
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "github-actions[bot]@users.noreply.github.com"
40+
git add .
41+
git commit -m "chore: version bump"
42+
git push
43+
44+
- name: Get package version
45+
id: get-version
46+
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
47+
48+
- name: Create GitHub Release
49+
uses: softprops/action-gh-release@v1
50+
with:
51+
tag_name: v${{ steps.get-version.outputs.VERSION }}
52+
name: v${{ steps.get-version.outputs.VERSION }}
53+
body_path: ./CHANGELOG.md
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Publish to npm
58+
run: npx changeset publish
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)