Skip to content

Commit 7c63260

Browse files
committed
ci: fix conventional graduate
lerna/lerna#2532
1 parent 39824c4 commit 7c63260

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: 'actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744' # v3.6.0
3838
# run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3939
with:
40-
fetch-depth: '0'
40+
fetch-depth: 0
4141

4242
# - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
4343
# persist-credentials: false
@@ -112,13 +112,25 @@ jobs:
112112

113113
- name: 'Lerna publish [main]'
114114
if: github.ref == 'refs/heads/main'
115-
# --create-release=github not working
115+
# https://github.com/lerna/lerna/issues/2532
116+
id: graduateRelease
117+
continue-on-error: true
116118
env:
117119
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
118120
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' # Not really needed (already global)
119121
run: |
120122
pnpm lerna publish --conventional-commits --exact --conventional-graduate --create-release=github --yes
121123
124+
- name: Bump Prod Version Fallback
125+
if: ${{ always() && steps.graduateRelease.outcome == 'failure' }}
126+
env:
127+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
128+
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}'
129+
run: |
130+
echo Falling back to non-graduate release due to https://github.com/lerna/lerna/issues/2532
131+
git stash
132+
pnpm lerna publish --conventional-commits --exact --create-release=github --yes
133+
122134
- name: 'Lerna publish [next]'
123135
if: github.ref == 'refs/heads/next'
124136
env:

0 commit comments

Comments
 (0)