Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
11 changes: 11 additions & 0 deletions .changeset/config.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "v1-main",
"updateInternalDependencies": "patch",
"ignore": []
}
Comment on lines +1 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

This config will be ignored unless explicitly selected; wire it into the workflow

Changesets only reads .changeset/config.json by default. In this repo, the workflows never point the CLI/action to config.v1.json, so v1 branch runs will still use the main config. Ensure the v1 workflow overwrites/uses this file when running on refs/heads/v1-main.

Apply one of these:

  • Simple: copy v1 config over the default before publish/version on v1-main.
--- a/.github/workflows/release-changeset.yml
+++ b/.github/workflows/release-changeset.yml
@@ -52,6 +52,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-v1
         uses: changesets/action@v1
         with:
           publish: pnpm exec changeset publish
@@ -122,6 +128,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-rust-v1
         uses: changesets/action@v1
  • Alternative: keep only a single config.json per maintenance branch (recommended), and remove config.v1.json from main.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .changeset/config.v1.json (lines 1-11) the v1-specific Changesets config will
be ignored because workflows use .changeset/config.json by default; update the
v1-main CI workflow to ensure this file is used by either copying
.changeset/config.v1.json to .changeset/config.json before any
changesets/publish/version steps when refs/heads/v1-main are running, or else
remove config.v1.json and maintain a single .changeset/config.json for the v1
branch (i.e., add a conditional step that on v1-main copies the file prior to
running the Changesets CLI).

142 changes: 142 additions & 0 deletions .github/workflows/release-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Release with Changeset

on:
push:
branches:
- main
- v1-main

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

jobs:
release-js:
name: Release JS Plugins
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'js-plugins') || contains(github.event.head_commit.message, 'all')
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

- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build Packages
run: pnpm --filter "{js-plugins}[HEAD~1]" build

- name: Set npm access config
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set access public

- name: Create Release Pull Request or Publish to npm (main branch - beta)
if: github.ref == 'refs/heads/main'
id: changesets-main
uses: changesets/action@v1
with:
publish: pnpm exec changeset publish --tag beta
title: "Release: JS Plugins (Beta)"
commit: "chore: release js plugins (beta)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
if: github.ref == 'refs/heads/v1-main'
id: changesets-v1
uses: changesets/action@v1
with:
publish: pnpm exec changeset publish
title: "Release: JS Plugins (Stable)"
commit: "chore: release js plugins (stable)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

release-rust:
name: Release Rust Plugins
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'rust-plugins') || contains(github.event.head_commit.message, 'all')
needs: [call-rust-build]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Enable Corepack
run: corepack enable

# Download artifacts from build job
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts

- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
ls -R $folder_path
ls -R ./rust-plugins/${package}/npm/${abi}
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done

Comment on lines +90 to +107
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Artifact move can fail if target dirs don’t exist

mv will error when ./rust-plugins/${package}/npm/${abi} is missing. Add mkdir -p and safer bash options; list destination after move.

-      - name: Move Artifacts
-        run: |
-          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
+      - name: Move Artifacts
+        run: |
+          set -euo pipefail
+          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
           do
             for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
               do
                 folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
                 if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
-                  mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
-                  ls -R $folder_path
-                  ls -R ./rust-plugins/${package}/npm/${abi}
+                  dest="./rust-plugins/${package}/npm/${abi}"
+                  mkdir -p "$dest"
+                  ls -R "$folder_path"
+                  mv "$folder_path"/* "$dest"/
+                  ls -R "$dest"
                   test -f ./rust-plugins/${package}/npm/${abi}/index.farm
                 else
                   echo "${folder_path} is empty"
                 fi
               done
           done
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
ls -R $folder_path
ls -R ./rust-plugins/${package}/npm/${abi}
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done
- name: Move Artifacts
run: |
set -euo pipefail
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
do
folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
dest="./rust-plugins/${package}/npm/${abi}"
mkdir -p "$dest"
ls -R "$folder_path"
mv "$folder_path"/* "$dest"/
ls -R "$dest"
test -f ./rust-plugins/${package}/npm/${abi}/index.farm
else
echo "${folder_path} is empty"
fi
done
done
🤖 Prompt for AI Agents
.github/workflows/release-changeset.yml around lines 90 to 107: the loop moves
artifacts into ./rust-plugins/${package}/npm/${abi} but mv will fail if the
destination directory doesn't exist and the script lacks safer bash flags;
before calling mv, create the destination with mkdir -p (use the fully expanded
destination path), ensure variables are quoted, and enable safer shell options
(e.g. set -euo pipefail at script start or within the job) so failures surface;
after a successful move, list the destination to verify (ls -R destination) and
keep the existing empty-folder echo path for clarity.

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Set npm access config
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set access public

- name: Create Release Pull Request or Publish to npm (main branch - beta)
if: github.ref == 'refs/heads/main'
id: changesets-rust-main
uses: changesets/action@v1
with:
publish: pnpm exec changeset publish --tag beta
title: "Release: Rust Plugins (Beta)"
commit: "chore: release rust plugins (beta)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
if: github.ref == 'refs/heads/v1-main'
id: changesets-rust-v1
uses: changesets/action@v1
with:
publish: pnpm exec changeset publish
title: "Release: Rust Plugins (Stable)"
commit: "chore: release rust plugins (stable)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

call-rust-build:
if: contains(github.event.head_commit.message, 'rust-plugins') || contains(github.event.head_commit.message, 'all')
uses: ./.github/workflows/build.yaml
47 changes: 0 additions & 47 deletions .github/workflows/release-js-plugins.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/release-rust-plugins.yml

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"packageManager": "pnpm@9.1.0",
"scripts": {
"release": "npx changeset && npx changeset version",
"changeset": "changeset",
"version-packages": "changeset version",
"release-packages": "changeset publish",
"prepare": "husky install",
"commit": "git cz"
},
Expand Down