File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 4646 - name : Build
4747 run : pnpm run build
4848
49+ - name : Extract version from tag
50+ id : version
51+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
52+
53+ - name : Update package versions to tag version
54+ run : |
55+ VERSION="${{ steps.version.outputs.VERSION }}"
56+ echo "Updating all packages to version $VERSION"
57+
58+ # Update all package.json files in packages directory
59+ for pkg in packages/*/package.json; do
60+ echo "Updating $pkg to version $VERSION"
61+ jq --arg version "$VERSION" '.version = $version' "$pkg" > tmp.json && mv tmp.json "$pkg"
62+ done
63+
64+ - name : Create GitHub Release
65+ uses : softprops/action-gh-release@v1
66+ with :
67+ tag_name : ${{ github.ref_name }}
68+ name : Release ${{ steps.version.outputs.VERSION }}
69+ draft : false
70+ prerelease : false
71+ env :
72+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+
4974 - name : Publish to npm
50- run : pnpm publish -r --filter "{packages/*}" --access public --no-git-checks --provenance
75+ run : |
76+ VERSION="${{ steps.version.outputs.VERSION }}"
77+ # Check if version contains pre-release identifier
78+ if [[ "$VERSION" =~ -[a-zA-Z0-9.-]+$ ]]; then
79+ # This is a pre-release version
80+ pnpm publish -r --filter "{packages/*}" --access public --no-git-checks --tag beta
81+ else
82+ # This is a stable release
83+ pnpm publish -r --filter "{packages/*}" --access public --no-git-checks --tag latest
84+ fi
You can’t perform that action at this time.
0 commit comments