6
6
jobs :
7
7
publish-patch :
8
8
runs-on : ubuntu-latest
9
- defaults :
10
- run :
11
- working-directory : library
12
9
13
10
steps :
14
11
- uses : actions/checkout@v4
@@ -20,12 +17,14 @@ jobs:
20
17
node-version : 22
21
18
registry-url : https://registry.npmjs.org/
22
19
23
- - name : Install dependencies in root
20
+ - name : Install all workspace dependencies
24
21
run : npm install
25
- working-directory : ..
22
+ working-directory : .
26
23
27
24
- name : Bump patch version and create branch
28
25
run : |
26
+ cd library
27
+
29
28
# Bump version in library/package.json
30
29
npm version prepatch --no-git-tag-version --preid=alpha > /dev/null
31
30
new_version=$(node -p "require('./package.json').version")
@@ -39,29 +38,23 @@ jobs:
39
38
git config user.name "github-actions"
40
39
git config user.email "[email protected] "
41
40
42
- # Add package.json from library and package-lock.json from root
43
- files_to_add="package.json"
44
- root_package_lock="../package-lock.json"
45
- if [ -f "$root_package_lock" ]; then
46
- files_to_add="$files_to_add $root_package_lock"
47
- else
48
- echo "Warning: $root_package_lock not found in root directory"
49
- fi
50
- git add $files_to_add
51
- git commit -m "chore(release): bump prepatch version to $new_version"
41
+ # Add updated files
42
+ git add library/package.json package-lock.json
52
43
53
- # Push new branch
44
+ git commit -m "chore(release): bump prepatch version to $new_version"
54
45
git push origin "$branch_name"
55
46
56
- # Store branch name and version for next steps
47
+ # Set outputs
57
48
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
58
49
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
59
50
60
- - name : Build
51
+ - name : Build library
61
52
run : npm run build
53
+ working-directory : library
62
54
63
55
- name : Publish to npm
64
56
run : npm publish --access public --tag latest
57
+ working-directory : library
65
58
env :
66
59
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
67
60
0 commit comments