Skip to content

Commit cc4e8f2

Browse files
author
Auto Version Bump
committed
fix: workflows
1 parent 81b78b8 commit cc4e8f2

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

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

Lines changed: 18 additions & 19 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
@@ -17,20 +14,28 @@ jobs:
1714

1815
- uses: actions/setup-node@v4
1916
with:
20-
node-version: 22
17+
node-version: 22.14.0
2118
registry-url: https://registry.npmjs.org/
2219

23-
- name: Install dependencies in root
20+
- name: Set correct npm version
21+
run: npm install -g [email protected]
22+
23+
- name: Install all workspace dependencies
2424
run: npm install
25-
working-directory: ..
25+
working-directory: .
2626

2727
- name: Bump Minor version and create branch
2828
run: |
29+
cd library
30+
2931
# Bump version in library/package.json
3032
npm version preminor --no-git-tag-version --preid=alpha > /dev/null
3133
new_version=$(node -p "require('./package.json').version")
3234
echo "New version: $new_version"
3335
36+
# Go back to the root directory
37+
cd ..
38+
3439
# Create and checkout new branch
3540
branch_name="chore/version-bump-minor-${new_version}"
3641
git checkout -b "$branch_name"
@@ -39,29 +44,23 @@ jobs:
3944
git config user.name "github-actions"
4045
git config user.email "[email protected]"
4146
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 preminor version to $new_version"
47+
# Add updated files
48+
git add library/package.json package-lock.json
5249
53-
# Push new branch
50+
git commit -m "chore(release): bump preminor version to $new_version"
5451
git push origin "$branch_name"
5552
56-
# Store branch name and version for next steps
53+
# Set outputs
5754
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
5855
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
5956
60-
- name: Build
57+
- name: Build library
6158
run: npm run build
59+
working-directory: library
6260

6361
- name: Publish to npm
6462
run: npm publish --access public --tag latest
63+
working-directory: library
6564
env:
6665
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6766

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ jobs:
1414

1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 22
17+
node-version: 22.14.0
1818
registry-url: https://registry.npmjs.org/
1919

20+
- name: Set correct npm version
21+
run: npm install -g [email protected]
22+
2023
- name: Install all workspace dependencies
2124
run: npm install
2225
working-directory: .

0 commit comments

Comments
 (0)