File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change 11name : Publish latest builds
22
33on :
4- release :
5- types : [created]
64 workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Version to publish (e.g., 1.2.3)'
8+ required : true
9+ type : string
710
811jobs :
912 publish :
2427 - name : Install dependencies
2528 run : pnpm install --frozen-lockfile
2629
30+ - name : Validate version input
31+ run : |
32+ if ! [[ "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
33+ echo "❌ Version must be in semantic version format (e.g., 1.2.3)"
34+ exit 1
35+ fi
36+
37+ - name : Update package versions
38+ run : |
39+ target_version="${{ github.event.inputs.version }}"
40+ echo "Setting version to: $target_version"
41+
42+ for dir in packages/*; do
43+ [ -f "$dir/package.json" ] || continue
44+ echo "Updating $dir/package.json..."
45+ node -e "
46+ const fs = require('fs');
47+ const path = './$dir/package.json';
48+ const pkg = require(path);
49+ pkg.version = '$target_version';
50+ fs.writeFileSync(path, JSON.stringify(pkg, null, 2));
51+ console.log('Updated ' + pkg.name + ' to version ' + pkg.version);
52+ "
53+ done
54+
2755 - name : Build packages
2856 run : pnpm dlx turbo build --filter='./packages/*'
2957
You can’t perform that action at this time.
0 commit comments