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 1
1
name : Publish latest builds
2
2
3
3
on :
4
- release :
5
- types : [created]
6
4
workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ description : ' Version to publish (e.g., 1.2.3)'
8
+ required : true
9
+ type : string
7
10
8
11
jobs :
9
12
publish :
24
27
- name : Install dependencies
25
28
run : pnpm install --frozen-lockfile
26
29
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
+
27
55
- name : Build packages
28
56
run : pnpm dlx turbo build --filter='./packages/*'
29
57
You can’t perform that action at this time.
0 commit comments