Skip to content

Commit fcc31de

Browse files
authored
fix: prevent double build in deploy workflow (#2343)
1 parent c578aaf commit fcc31de

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/deploy-package.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
schedule:
66
- cron: '0 12 * * MON'
77

8+
permissions:
9+
contents: write
10+
id-token: write
11+
812
jobs:
913
deploy:
1014
runs-on: ubuntu-24.04
@@ -14,6 +18,7 @@ jobs:
1418
with:
1519
fetch-depth: '0'
1620
persist-credentials: false
21+
token: ${{ secrets.GH_TOKEN }}
1722
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1823

1924
- name: Setup SSH signing
@@ -47,14 +52,19 @@ jobs:
4752
- run: make build
4853

4954
- name: Version package with lerna
50-
run: make publish
55+
run: |
56+
pnpm lerna changed
57+
# Commit any generated files before versioning
58+
git add .
59+
git commit -m "chore: update generated files" || true
60+
pnpm lerna version -y --no-private --force-git-tag --create-release github
5161
env:
5262
HUSKY: 0
5363
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5464

5565
# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
5666
- name: Publish to npm
57-
run: make publish
67+
run: pnpm -r publish --access public --tag latest
5868
env:
5969
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6070
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)