Skip to content

Commit 4731270

Browse files
bitsnapsqwencoder
andcommitted
fix(ci): improve pnpm lockfile handling in publish workflow
Co-authored-by: Qwen-Coder <[email protected]>
1 parent 9d0b403 commit 4731270

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: List files
19+
run: ls -la
20+
- name: Check pnpm-lock.yaml
21+
run: |
22+
if [ -f "pnpm-lock.yaml" ]; then
23+
echo "pnpm-lock.yaml found"
24+
ls -l pnpm-lock.yaml
25+
else
26+
echo "pnpm-lock.yaml NOT found"
27+
fi
1628
- name: Install pnpm
1729
uses: pnpm/action-setup@v4
1830
with:
@@ -23,7 +35,14 @@ jobs:
2335
node-version: 20
2436
cache: 'pnpm'
2537
- name: Install dependencies
26-
run: pnpm install --frozen-lockfile
38+
run: |
39+
if [ -f "pnpm-lock.yaml" ]; then
40+
echo "Installing with frozen lockfile"
41+
pnpm install --frozen-lockfile
42+
else
43+
echo "Installing without frozen lockfile"
44+
pnpm install
45+
fi
2746
- name: Run tests
2847
run: pnpm test
2948

@@ -32,6 +51,18 @@ jobs:
3251
runs-on: ubuntu-latest
3352
steps:
3453
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
- name: List files
57+
run: ls -la
58+
- name: Check pnpm-lock.yaml
59+
run: |
60+
if [ -f "pnpm-lock.yaml" ]; then
61+
echo "pnpm-lock.yaml found"
62+
ls -l pnpm-lock.yaml
63+
else
64+
echo "pnpm-lock.yaml NOT found"
65+
fi
3566
- name: Install pnpm
3667
uses: pnpm/action-setup@v4
3768
with:
@@ -43,7 +74,14 @@ jobs:
4374
registry-url: https://registry.npmjs.org/
4475
cache: 'pnpm'
4576
- name: Install dependencies
46-
run: pnpm install --frozen-lockfile
77+
run: |
78+
if [ -f "pnpm-lock.yaml" ]; then
79+
echo "Installing with frozen lockfile"
80+
pnpm install --frozen-lockfile
81+
else
82+
echo "Installing without frozen lockfile"
83+
pnpm install
84+
fi
4785
- name: Publish to npm
4886
run: pnpm publish --no-git-checks
4987
env:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"preferGlobal": true,
1010
"type": "module",
11+
"packageManager": "[email protected]",
1112
"scripts": {
1213
"start": "node bin/index.js",
1314
"test": "TZ=UTC vitest run tests/*",

0 commit comments

Comments
 (0)