diff --git a/.changeset/light-tables-greet.md b/.changeset/light-tables-greet.md new file mode 100644 index 00000000..4b655089 --- /dev/null +++ b/.changeset/light-tables-greet.md @@ -0,0 +1,7 @@ +--- +"@caravan/bitcoin": major +"@caravan/wallets": major +"@caravan/coordinator": major +--- + +initial publication of new monorepo-based packages and app diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a906f4ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..26788d10 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/README.md b/README.md index 242766f5..30bb650c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/apps/coordinator/package.json b/apps/coordinator/package.json index 4b248961..f2e75f01 100644 --- a/apps/coordinator/package.json +++ b/apps/coordinator/package.json @@ -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" diff --git a/package.json b/package.json index fa1b5030..8c120c01 100644 --- a/package.json +++ b/package.json @@ -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": "*", diff --git a/packages/caravan-bitcoin/package.json b/packages/caravan-bitcoin/package.json index ab9a149d..269459c2 100644 --- a/packages/caravan-bitcoin/package.json +++ b/packages/caravan-bitcoin/package.json @@ -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", diff --git a/packages/caravan-wallets/package.json b/packages/caravan-wallets/package.json index 0d336d87..561e246b 100644 --- a/packages/caravan-wallets/package.json +++ b/packages/caravan-wallets/package.json @@ -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",