Skip to content

Commit a9a00b7

Browse files
committed
Add changesets and CI
1 parent a91411f commit a9a00b7

File tree

4 files changed

+149
-0
lines changed

4 files changed

+149
-0
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "codama-idl/renderers-demo" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch"
11+
}

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
time: '01:00'
8+
timezone: America/Los_Angeles
9+
open-pull-requests-limit: 10

.github/workflows/main.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
# Among other things, opts out of Turborepo telemetry. See https://consoledonottrack.com/.
10+
DO_NOT_TRACK: '1'
11+
NODE_VERSION: 20
12+
SOLANA_VERSION: 2.1.9
13+
14+
jobs:
15+
lint:
16+
name: Check styling
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Git checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v3
24+
25+
- name: Setup Node.js ${{ env.NODE_VERSION }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ env.NODE_VERSION }}
29+
cache: 'pnpm'
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Compile JS and types
35+
run: pnpm run build
36+
37+
- name: Check linting
38+
run: pnpm run lint
39+
40+
tests:
41+
name: Test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Git checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v3
49+
50+
- name: Setup Node.js ${{ env.NODE_VERSION }}
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: ${{ env.NODE_VERSION }}
54+
cache: 'pnpm'
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Build and run tests
60+
run: pnpm build && pnpm test
61+
62+
- name: Ensure working directory is clean
63+
run: |
64+
git status
65+
test -z "$(git status --porcelain)"
66+
67+
release:
68+
name: Release
69+
runs-on: ubuntu-latest
70+
if: github.event_name == 'push'
71+
needs: [lint, tests]
72+
permissions:
73+
contents: write
74+
pull-requests: write
75+
outputs:
76+
published: ${{ steps.changesets.outputs.published }}
77+
steps:
78+
- name: Checkout Repo
79+
uses: actions/checkout@v4
80+
81+
- name: Setup pnpm
82+
uses: pnpm/action-setup@v3
83+
84+
- name: Setup Node.js ${{ env.NODE_VERSION }}
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: ${{ env.NODE_VERSION }}
88+
cache: 'pnpm'
89+
90+
- name: Install Dependencies
91+
run: pnpm install --frozen-lockfile
92+
93+
- name: Create Release Pull Request or Publish
94+
id: changesets
95+
uses: changesets/action@v1
96+
with:
97+
commit: 'Publish package'
98+
title: 'Publish package'
99+
publish: pnpm build && pnpm changeset publish
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
103+
104+
dependabot:
105+
runs-on: ubuntu-latest
106+
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'codama-idl/renderers-demo'
107+
needs: [lint, tests]
108+
permissions:
109+
contents: write
110+
pull-requests: write
111+
steps:
112+
- name: Auto-approve the PR
113+
run: gh pr review --approve "$PR_URL"
114+
env:
115+
PR_URL: ${{ github.event.pull_request.html_url }}
116+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
- name: Enable auto-merge
118+
run: gh pr merge --auto --squash "$PR_URL"
119+
env:
120+
PR_URL: ${{ github.event.pull_request.html_url }}
121+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)