From 83867733e9072d4dcdb18ffbcfc75e2e95e36091 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 5 Jun 2024 15:58:08 +0200 Subject: [PATCH 1/4] feat(repo): add changeset cli --- .changeset/README.md | 8 ++++++++ .changeset/config.json | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 00000000..e5b6d8d6 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..e4c1124e --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "xyflow/xyflow" }], + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} From a1656832bfb3929095a05a7b08262913e39ceca8 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 5 Jun 2024 17:41:50 +0200 Subject: [PATCH 2/4] chore(changesets): ignore examples --- .changeset/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index e4c1124e..a917162b 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["astro", "react-examples", "svelte-examples"] } From 25e52f78b955e2fcdcabdcc9bdddcacdb0a76088 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 1 Jul 2024 12:13:08 +0200 Subject: [PATCH 3/4] feat(workflow): add release action --- .changeset/config.json | 2 +- .github/actions/ci-checks/action.yml | 19 ++++++++++++++++++ .github/actions/ci-setup/action.yml | 15 ++++++++++++++ .github/workflows/release.yml | 29 ++++++++++++++++++++++++++++ examples/astro-xyflow/package.json | 2 +- 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 .github/actions/ci-checks/action.yml create mode 100644 .github/actions/ci-setup/action.yml create mode 100644 .github/workflows/release.yml diff --git a/.changeset/config.json b/.changeset/config.json index a917162b..02ee8b55 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": ["astro", "react-examples", "svelte-examples"] + "ignore": ["astro", "react-examples", "svelte-examples", "astro-examples", "playwright"] } diff --git a/.github/actions/ci-checks/action.yml b/.github/actions/ci-checks/action.yml new file mode 100644 index 00000000..b4d61378 --- /dev/null +++ b/.github/actions/ci-checks/action.yml @@ -0,0 +1,19 @@ +name: 'CI checks' + +runs: + using: 'composite' + steps: + - name: Build + run: pnpm build + shell: bash + - name: Typecheck + run: pnpm typecheck + shell: bash + - name: Install Playwright browsers + run: npx playwright install --with-deps + - name: Test React Flow + run: pnpm test:react + shell: bash + # - name: Test Svelte Flow + # run: pnpm test:svelte + # shell: bash diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml new file mode 100644 index 00000000..3d7f1bef --- /dev/null +++ b/.github/actions/ci-setup/action.yml @@ -0,0 +1,15 @@ +name: 'CI setup' + +runs: + using: 'composite' + steps: + - name: Setup pnpm + uses: pnpm/action-setup@v4 + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ae36b619 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - uses: ./.github/actions/ci-setup + - uses: ./.github/actions/ci-checks + + - name: Create release PR or publish to npm + id: changesets + uses: xyflow/changeset-action@v1 + with: + publish: pnpm release + title: Release packages + commit: 'chore(packages): bump' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/examples/astro-xyflow/package.json b/examples/astro-xyflow/package.json index c5e498db..94d6e199 100644 --- a/examples/astro-xyflow/package.json +++ b/examples/astro-xyflow/package.json @@ -1,5 +1,5 @@ { - "name": "astro", + "name": "astro-examples", "type": "module", "private": true, "version": "0.0.1", From a128a7e77d5f1c9733c9bac4ec97c81bd7996c5e Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 1 Jul 2024 12:19:16 +0200 Subject: [PATCH 4/4] chore(docs): explain release workflow --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 3f16bdab..b398b065 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,15 @@ npm install @xyflow/svelte ``` +## Releases + +For releasing packages we are using [changesets](https://github.com/changesets/changesets) in combination with the [changeset Github action](https://github.com/changesets/action). The rough idea is: + +1. create PRs for new features, updates and fixes (with a changeset if relevant for changelog) +2. merge into main +3. changset creates a PR that bumps all packages based on the changesets +4. merge changeset PR if you want to release to Github and npm + ## The xyflow team React Flow and Svelte Flow are maintained by the team behind [xyflow](https://xyflow.com). If you need help or want to talk to us about a collaboration, reach out through our [contact form](https://xyflow.com/contact) or by joining our [Discord Server](https://discord.gg/Bqt6xrs).