Skip to content

Commit 8ab2455

Browse files
committed
clients/ci: use changeset CI to manage releases
1 parent 0b50950 commit 8ab2455

File tree

7 files changed

+55
-82
lines changed

7 files changed

+55
-82
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
if: github.repository == 'polarsource/polar'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v3
18+
19+
- uses: pnpm/[email protected]
20+
with:
21+
version: 8.7.0
22+
23+
- name: Setup Node.js environment
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: v18
27+
cache: 'pnpm'
28+
cache-dependency-path: 'clients/pnpm-lock.yaml'
29+
registry-url: 'https://registry.npmjs.org'
30+
31+
- name: Install dependencies
32+
working-directory: ./clients
33+
run: pnpm install
34+
35+
- name: Create Release Pull Request or Publish to npm
36+
working-directory: ./clients
37+
# https://github.com/changesets/action
38+
uses: changesets/action@v1
39+
with:
40+
# this expects you to have a script called release which does a build for your packages and calls changeset publish
41+
publish: pnpm publish-packages
42+
version: pnpm version-packages
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish_npm_astro.yaml

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

.github/workflows/publish_npm_sdk.yaml

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

clients/.changeset/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# Changesets
22

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)
3+
Polar is using https://github.com/changesets/changesets to manage releases to NPM.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@polar-sh/astro": patch
3+
"@polar-sh/sdk": patch
4+
---
5+
6+
Release

clients/.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"access": "restricted",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": ["polarkit", "web", "chrome-extension"]
10+
"ignore": ["!@polar-sh/*"]
1111
}

clients/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
1313
"preinstall": "npx only-allow pnpm",
1414
"postinstall": "manypkg check",
15-
"publish-packages": "pnpm build && pnpm test && changeset version && changeset publish"
15+
"publish-packages": "pnpm build && pnpm test && changeset version && changeset publish",
16+
"version-packages": "changeset version"
1617
},
1718
"dependencies": {
1819
"@changesets/cli": "^2.27.1",

0 commit comments

Comments
 (0)