Skip to content

Commit 045aa80

Browse files
committed
feat: Auto-doc docs website
1 parent 6b02e3f commit 045aa80

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

.github/workflows/publish-npm.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Lerna Versioning and Publish
33
on:
44
push:
55
branches:
6-
- main # Trigger on push to the main branch
6+
- main
77
tags:
8-
- 'v*' # Trigger on version tags (e.g., v1.0.0)
8+
- 'v*'
99

1010
jobs:
1111
versioning-and-publishing:
@@ -32,18 +32,42 @@ jobs:
3232
git config --global user.name "GitHub Actions"
3333
git config --global user.email "github-actions[bot]@users.noreply.github.com"
3434
35-
- name: Run Lerna Version
35+
- name: Run Lerna Version and Capture Tag
36+
id: version
3637
run: |
37-
npx lerna version --conventional-commits --yes # Auto version bump based on commit messages
38+
# Save current tags before running lerna version
39+
git tag > before_tags.txt
40+
41+
# Run lerna version (will only bump if relevant commits exist)
42+
npx lerna version --conventional-commits --yes --no-push
43+
44+
# Save tags after lerna version
45+
git tag > after_tags.txt
46+
47+
# Compare tags before and after
48+
if diff before_tags.txt after_tags.txt > /dev/null; then
49+
echo "published=false" >> $GITHUB_OUTPUT
50+
else
51+
echo "published=true" >> $GITHUB_OUTPUT
52+
fi
3853
3954
- name: Publish to npm
55+
if: steps.version.outputs.published == 'true'
4056
run: |
41-
npx lerna publish from-package --yes # Publish the updated packages to npm
42-
57+
npx lerna publish from-package --yes
4358
env:
4459
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4560

4661
- name: Push commit and tag
62+
if: steps.version.outputs.published == 'true'
4763
run: |
48-
git push origin main # Push the version bump commit to main
49-
git push origin --tags # Push the new tag created by lerna version
64+
git push origin main
65+
git push origin --tags
66+
67+
- name: Dispatch to Other Repo
68+
if: steps.version.outputs.published == 'true'
69+
uses: peter-evans/repository-dispatch@v2
70+
with:
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
repository: SteamClientHomebrew/SteamBrew
73+
event-type: on-millennium-sdk-updated

0 commit comments

Comments
 (0)