-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up CI and automated publishing (#2)
* Set up CI and automated publishing * Add README.md * Tweak comment
- Loading branch information
1 parent
fd37afb
commit 953e36e
Showing
6 changed files
with
2,072 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"access": "public", | ||
"baseBranch": "main", | ||
"privatePackages": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
merge_group: | ||
|
||
concurrency: | ||
# Ensure that we only run one concurrent job for Pull Requests. This ensures | ||
# that someone can't kill our throughput by pushing a bunch of commits to a | ||
# single branch in rapid succession. | ||
# | ||
# However, for master builds, we allow maximum concurrency. This is achieved | ||
# because `github.head_ref` isn't defined there, and `github.run_id` is | ||
# globally unique in this repo. | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: 'yarn' | ||
|
||
- run: yarn install --immutable --inline-builds | ||
|
||
- run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: 'yarn' | ||
|
||
- name: Install Dependencies | ||
run: yarn --immutable | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
# This invokes the `version` script in `package.json`, which will run | ||
# `changeset version` and then `yarn`. We need to run `yarn` in order | ||
# to update `yarn.lock`: https://github.com/changesets/action/issues/170 | ||
version: yarn version | ||
# This invokes the `release` script in `package.json`, which will build | ||
# the packages and then invoke `changeset publish`. | ||
publish: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# This token was generated by Nathan Walters on 2024-06-17. | ||
# It expires on 2030-01-01. | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
# excalidraw-builds | ||
|
||
Excalidraw pre-bundled with React. | ||
|
||
## Releasing a new version | ||
|
||
This repository uses [Changesets](https://github.com/changesets/changesets) to automate the versioning process. | ||
|
||
When adding changes that should be released, run the following command and follow the prompts: | ||
|
||
```sh | ||
yarn changeset | ||
``` | ||
|
||
Commit the changeset file that was created and submit it with your PR. | ||
|
||
Once the PR is merged, a versioning PR will be opened automatically, and it will stay up to date as additional PRs are merged. | ||
|
||
Once you're ready to release a new version, merge the versioning PR and the new version will be published to npm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,21 @@ | |
"description": "Excalidraw bundled with React", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"files": ["dist"], | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": "[email protected]:PrairieLearn/excalidraw-builds.git", | ||
"scripts": { | ||
"build": "node esbuild.config.js" | ||
"build": "node esbuild.config.js", | ||
"release": "yarn build && changeset publish", | ||
"version": "changeset version && yarn" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.5", | ||
"@excalidraw/excalidraw": "0.17.1-2f9526d", | ||
"esbuild": "^0.21.3", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"esbuild": "^0.21.3" | ||
} | ||
"react-dom": "18.3.1" | ||
}, | ||
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72" | ||
} |
Oops, something went wrong.