Skip to content

Commit

Permalink
Merge pull request #1 from caravan-bitcoin/init-published-packages
Browse files Browse the repository at this point in the history
add github workflows
  • Loading branch information
bucko13 authored Feb 12, 2024
2 parents 8c06258 + bba4758 commit 6dd0267
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .changeset/light-tables-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@caravan/bitcoin": major
"@caravan/wallets": major
"@caravan/coordinator": major
---

initial publication of new monorepo-based packages and app
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["20.x"]

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types: [published]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install Dependencies
run: npm install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
version: npm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ In the caravan monorepo we use `changesets` to manage versioning and releases.
A changeset will be _required_ for PRs to be merged. Read below to learn more.

### Changesets

#### Quickstart
Any PR to caravan that introduces a functional change requires a changeset be submitted with it.

Simply run the following command and follow the cli instructions:

```
$ npm run changesets
```

Learn about [semantic versioning](https://docs.npmjs.com/about-semantic-versioning) if you
are unsure whether your changes qualify as a patch, minor, or major change.

Pull Requests are checked for changesets by the [changeset-bot](https://github.com/apps/changeset-bot).

[Changesets GitHub Actions](https://github.com/changesets/action) are run to create a version PR
and publish on merge.

#### About Changesets
This is the [recommended way by Turborepo](https://turbo.build/repo/docs/handbook/publishing-packages/versioning-and-publishing)
to handle changelogs, versioning, and releases.
It's designed first as a manual process, so by default it won't "yell" at you to do
Expand All @@ -71,13 +90,6 @@ And another good resource for what the workflow should look like [here](https://

[Automating Changesets](https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md)

Rough steps to implement:
- [Intro by Turborepo](https://turbo.build/repo/docs/handbook/publishing-packages/versioning-and-publishing)
- [Intro to using changesets](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md)
- [Example project](https://github.com/vercel/turbo/tree/main/examples/with-changesets)
- Add [changeset bot](https://github.com/apps/changeset-bot) - gets CI to check for changesets
- Automate versioning and publishing in CI with [GitHub Actions](https://github.com/changesets/action)


## Getting started

Expand Down
8 changes: 4 additions & 4 deletions apps/coordinator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"version": "0.0.0-beta",
"description": "Unchained Capital's Bitcoin Multisig Coordinator Application",
"main": "index.jsx",
"publicPrivate": true,
"private": true,
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/unchained-capital/caravan"
"url": "https://github.com/caravan-bitcoin/caravan/apps/coordinator"
},
"author": "Unchained Capital",
"license": "MIT",
"bugs": {
"url": "https://github.com/unchained-capital/caravan/issues"
"url": "https://github.com/caravan-bitcoin/caravan/issues"
},
"homepage": "https://unchained-capital.github.io/caravan",
"homepage": "https://github.com/caravan-bitcoin/caravan",
"engineStrict": true,
"engines": {
"node": ">=20"
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"private": true,
"scripts": {
"build": "turbo build",
"changeset": "changeset",
"ci": "turbo run build lint test",
"dev": "turbo dev",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"gen": "turbo gen run"
"gen": "turbo gen run",
"lint": "turbo lint",
"version": "turbo run build lint test && changeset version",
"release": "turbo run build lint test && changeset publish"
},
"devDependencies": {
"@caravan/eslint-config": "*",
Expand Down
8 changes: 4 additions & 4 deletions packages/caravan-bitcoin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"module": "./dist/index.mjs",
"repository": {
"type": "git",
"url": "git+https://github.com/unchained-capital/unchained-bitcoin.git"
"url": "https://github.com/caravan-bitcoin/caravan/packages/caravan-bitcoin"
},
"author": "Unchained Capital",
"license": "MIT",
"bugs": {
"url": "https://github.com/unchained-capital/unchained-bitcoin/issues"
"url": "https://github.com/caravan-bitcoin/caravan/issues"
},
"homepage": "https://unchained-capital.github.io/unchained-bitcoin",
"homepage": "https://github.com/caravan-bitcoin/caravan/",
"engines": {
"node": ">=16"
"node": ">=20"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/caravan-wallets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"module": "./dist/index.mjs",
"repository": {
"type": "git",
"url": "git+https://github.com/unchained-capital/unchained-wallets.git"
"url": "https://github.com/caravan-bitcoin/caravan/packages/caravan-wallets"
},
"author": "Unchained Capital",
"license": "MIT",
"bugs": {
"url": "https://github.com/unchained-capital/unchained-wallets/issues"
"url": "https://github.com/caravan-bitcoin/caravan/issues"
},
"homepage": "https://github.com/unchained-capital/unchained-wallets",
"homepage": "https://github.com/caravan-bitcoin/caravan/",
"engines": {
"node": ">=16"
"node": ">=20"
},
"devDependencies": {
"@babel/cli": "^7.20.7",
Expand Down

0 comments on commit 6dd0267

Please sign in to comment.