Skip to content

Commit cfa08a7

Browse files
committed
fix: separate syncing of lockfile to separate job
1 parent 377a272 commit cfa08a7

File tree

2 files changed

+171
-12
lines changed

2 files changed

+171
-12
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66

77
env:
88
CPU_CORES: 2
9-
HUSKY: 1
10-
HUSKY_DEBUG: 1
9+
HUSKY: 0
1110

1211
jobs:
1312
release:
@@ -35,22 +34,36 @@ jobs:
3534
# run: npm run test
3635
- name: Version bump & GitHub release
3736
run: |
38-
# Sync lockfile before commit
39-
npx husky
40-
echo -e 'npm install\ngit add package-lock.json' > .husky/pre-commit
41-
chmod +x .husky/pre-commit
42-
43-
# Change version + release commit + push
4437
git config user.email "[email protected]"
4538
git config user.name "swagger-bot"
46-
CI='' npx lerna version prerelease --preid beta --no-private --yes --force-publish
39+
npx lerna version prerelease --preid beta --no-private --yes --force-publish
4740
env:
4841
GH_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
4942
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5043
- name: Publish monorepo npm packages
51-
run: |
52-
git checkout -- .husky/pre-commit
53-
CI='' npx lerna publish from-package --no-private --yes
44+
run: npx lerna publish from-package --no-private --yes
5445
env:
5546
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5647

48+
sync-lockfile:
49+
name: Sync lockfile
50+
runs-on: ubuntu-latest
51+
needs: release
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
59+
- name: Setup Node.js
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: 22.14.0
63+
registry-url: https://registry.npmjs.org
64+
- name: Sync lockfile
65+
run: |
66+
npm install
67+
git add package-lock.json
68+
git diff --quiet || git commit -m "chore: sync lockfile"
69+
git push origin main

package-lock.json

Lines changed: 146 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)