Skip to content

Commit a4ff86e

Browse files
author
Auto Version Bump
committed
fix: patch workflow fix
1 parent 5414698 commit a4ff86e

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

.github/workflows/publish-library-patch.yaml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
jobs:
77
publish-patch:
88
runs-on: ubuntu-latest
9-
defaults:
10-
run:
11-
working-directory: library
129

1310
steps:
1411
- uses: actions/checkout@v4
@@ -20,12 +17,14 @@ jobs:
2017
node-version: 22
2118
registry-url: https://registry.npmjs.org/
2219

23-
- name: Install dependencies in root
20+
- name: Install all workspace dependencies
2421
run: npm install
25-
working-directory: ..
22+
working-directory: .
2623

2724
- name: Bump patch version and create branch
2825
run: |
26+
cd library
27+
2928
# Bump version in library/package.json
3029
npm version prepatch --no-git-tag-version --preid=alpha > /dev/null
3130
new_version=$(node -p "require('./package.json').version")
@@ -39,29 +38,23 @@ jobs:
3938
git config user.name "github-actions"
4039
git config user.email "[email protected]"
4140
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
5243
53-
# Push new branch
44+
git commit -m "chore(release): bump prepatch version to $new_version"
5445
git push origin "$branch_name"
5546
56-
# Store branch name and version for next steps
47+
# Set outputs
5748
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
5849
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
5950
60-
- name: Build
51+
- name: Build library
6152
run: npm run build
53+
working-directory: library
6254

6355
- name: Publish to npm
6456
run: npm publish --access public --tag latest
57+
working-directory: library
6558
env:
6659
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6760

0 commit comments

Comments
 (0)