Skip to content

Commit b341a3a

Browse files
committed
Swap github workflows to pnpm
1 parent b3fd11b commit b341a3a

File tree

3 files changed

+23
-46
lines changed

3 files changed

+23
-46
lines changed

.github/workflows/manual-publish.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,19 @@ jobs:
3838
node-version: '18'
3939
registry-url: 'https://registry.npmjs.org'
4040

41+
- name: Setup pnpm
42+
uses: pnpm/action-setup@v4
43+
with:
44+
version: 10
45+
4146
- name: Install dependencies
42-
working-directory: packages/${{ github.event.inputs.package }}
43-
run: |
44-
if [ -f "yarn.lock" ]; then
45-
yarn install --frozen-lockfile
46-
else
47-
npm ci
48-
fi
47+
run: pnpm install --frozen-lockfile
4948

5049
- name: Build package
5150
working-directory: packages/${{ github.event.inputs.package }}
5251
run: |
5352
if grep -q '"build"' package.json; then
54-
if [ -f "yarn.lock" ]; then
55-
yarn build
56-
else
57-
npm run build
58-
fi
53+
pnpm build
5954
else
6055
echo "No build script found, skipping build step"
6156
fi

.github/workflows/publish-packages.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,20 @@ jobs:
7575
node-version: '18'
7676
registry-url: 'https://registry.npmjs.org'
7777

78+
- name: Setup pnpm
79+
uses: pnpm/action-setup@v4
80+
with:
81+
version: 10
82+
7883
- name: Install dependencies
79-
working-directory: packages/${{ matrix.package }}
80-
run: |
81-
if [ -f "yarn.lock" ]; then
82-
yarn install --frozen-lockfile
83-
else
84-
npm ci
85-
fi
84+
run: pnpm install --frozen-lockfile
8685

8786
- name: Build package
8887
working-directory: packages/${{ matrix.package }}
8988
run: |
9089
# Try different build commands based on what's available
9190
if grep -q '"build"' package.json; then
92-
if [ -f "yarn.lock" ]; then
93-
yarn build
94-
else
95-
npm run build
96-
fi
91+
pnpm build
9792
else
9893
echo "No build script found, skipping build step"
9994
fi

.github/workflows/test.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,20 @@ jobs:
7676
with:
7777
node-version: '18'
7878

79+
- name: Setup pnpm
80+
uses: pnpm/action-setup@v4
81+
with:
82+
version: 10
83+
7984
- name: Install dependencies
80-
working-directory: packages/${{ matrix.package }}
81-
run: |
82-
if [ -f "yarn.lock" ]; then
83-
yarn install --frozen-lockfile
84-
else
85-
npm ci
86-
fi
85+
run: pnpm install --frozen-lockfile
8786

8887
- name: Run tests
8988
working-directory: packages/${{ matrix.package }}
9089
run: |
9190
if grep -q '"test"' package.json && ! grep -q '"test":\s*""' package.json; then
9291
echo "Running tests for ${{ matrix.package }}"
93-
if [ -f "yarn.lock" ]; then
94-
yarn test
95-
else
96-
npm test
97-
fi
92+
pnpm test
9893
else
9994
echo "No tests found for ${{ matrix.package }}, skipping"
10095
fi
@@ -104,11 +99,7 @@ jobs:
10499
run: |
105100
if grep -q '"build"' package.json; then
106101
echo "Building ${{ matrix.package }}"
107-
if [ -f "yarn.lock" ]; then
108-
yarn build
109-
else
110-
npm run build
111-
fi
102+
pnpm build
112103
else
113104
echo "No build script found for ${{ matrix.package }}, skipping"
114105
fi
@@ -118,11 +109,7 @@ jobs:
118109
run: |
119110
if grep -q '"prettier"' package.json; then
120111
echo "Checking formatting for ${{ matrix.package }}"
121-
if [ -f "yarn.lock" ]; then
122-
yarn prettier --check .
123-
else
124-
npm run prettier -- --check .
125-
fi
112+
pnpm prettier --check .
126113
else
127114
echo "No prettier script found for ${{ matrix.package }}, skipping"
128115
fi

0 commit comments

Comments
 (0)