Skip to content

Commit b1b9e92

Browse files
committed
chore(release): progress messaegs, allow re-publish of existing version
- should give yet more insight into current system status while publishing - we publish "from-package" which means even if version fails, attempting re-publish is safe because it will only attempt to publish packages that don't already exist - do not attempt to publish on anything but workflow_dispatch, we never auto-publish
1 parent 687aa71 commit b1b9e92

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Publish
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
85

96
jobs:
107
publish_npm:
@@ -14,6 +11,7 @@ jobs:
1411
runs-on: ubuntu-latest
1512
permissions:
1613
id-token: write # enables OIDC for npmjs.com "Trusted Publisher" and provenance
14+
contents: read
1715
steps:
1816
- uses: actions/checkout@v4
1917
with:
@@ -24,7 +22,8 @@ jobs:
2422
- uses: actions/setup-node@v4
2523
with:
2624
node-version: 22
27-
- name: Install latest NPM
25+
- name: Install latest NPM
26+
# OIDC publishing requires a very up to date npm version
2827
run: |
2928
npm --version
3029
npm install -g npm@latest
@@ -43,9 +42,17 @@ jobs:
4342
git config --global user.email 'oss@invertase.io'
4443
- name: Publish Packages
4544
run: |
45+
npx envinfo
46+
echo "Verifying working directory is clean..."
4647
git diff --exit-code
47-
yarn lerna changed
48-
yarn lerna version --yes --force-publish=*
48+
echo "Displaying any current changes..."
49+
if yarn lerna changed; then
50+
echo "Changes detected, bumping versions..."
51+
yarn lerna version --yes --force-publish=*
52+
else
53+
echo "No changes detected, no versions bumped."
54+
fi
55+
echo "Syncing unpublished versions with package registry...""
4956
yarn lerna publish from-package --yes --loglevel trace
5057
env:
5158
# No NPM token needed, all of the packages have been configured

0 commit comments

Comments
 (0)