mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
migrate to pnpm (#609)
* migrate to `pnpm` * rename `simple-project` fixture packages to remove socket security errors * add pnpm `dedupe` options * update release-pr workflow * update * update snashots * tweaks * tweak * tweak * fix missing ci-setup * tweak * tweak deps * update pnpm * ok, Socket, let's rename them * update snapshots * rename again * fmt --------- Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
co-authored by
Mateusz Burzyński
parent
ccba80bb5a
commit
04ba326779
@@ -21,7 +21,7 @@ This action for [Changesets](https://github.com/changesets/changesets) creates a
|
||||
- published - A boolean value to indicate whether a publishing has happened or not
|
||||
- publishedPackages - A JSON array to present the published packages. The format is `[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]`
|
||||
|
||||
### Example workflow:
|
||||
### Example workflow
|
||||
|
||||
#### Without Publishing
|
||||
|
||||
@@ -43,15 +43,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js 20
|
||||
uses: actions/setup-node@v3
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Setup Node.js 26
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 26
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Create Release Pull Request
|
||||
uses: changesets/action@v1
|
||||
@@ -77,22 +80,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Setup Node.js 26
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 26
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
||||
publish: yarn release
|
||||
publish: pnpm release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@@ -104,7 +110,7 @@ jobs:
|
||||
|
||||
By default the GitHub Action creates a `.npmrc` file with the following content:
|
||||
|
||||
```
|
||||
```txt
|
||||
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}
|
||||
```
|
||||
|
||||
@@ -141,15 +147,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Setup Node.js 26
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 26
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
@@ -158,7 +167,7 @@ jobs:
|
||||
- name: Publish
|
||||
if: steps.changesets.outputs.hasChangesets == 'false'
|
||||
# You can do something when a publish should happen.
|
||||
run: yarn publish
|
||||
run: pnpm publish
|
||||
```
|
||||
|
||||
#### With version script
|
||||
@@ -183,21 +192,24 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js 20.x
|
||||
uses: actions/setup-node@v3
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Setup Node.js 26
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 26
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Create Release Pull Request
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
|
||||
version: yarn version
|
||||
version: pnpm version
|
||||
```
|
||||
|
||||
#### With Yarn 2 / Plug'n'Play
|
||||
@@ -208,5 +220,5 @@ If you are using [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp), you shoul
|
||||
- uses: changesets/action@v1
|
||||
with:
|
||||
version: yarn changeset version
|
||||
...
|
||||
# ...
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user