Skip to content

Commit 2ab5468

Browse files
authored
Refactor npm publish workflow for multiple packages
Updated the npm publish workflow to publish multiple packages from the 'packages' directory.
1 parent 8c94ba6 commit 2ab5468

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/npm-publish.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@ jobs:
1717
node-version: 22
1818
- run: npm ci
1919
- run: npm test
20-
21-
publish-npm:
22-
needs: build
20+
- name: Publish packages
2321
runs-on: ubuntu-latest
24-
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v4
27-
with:
28-
node-version: 22
29-
registry-url: https://registry.npmjs.org/
30-
- run: npm ci
31-
- run: npm publish
32-
env:
33-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22+
needs: build
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
registry-url: https://registry.npmjs.org/
28+
run: |
29+
for package_dir in packages/*; do
30+
if [[ -d "$package_dir" && { "$package_dir" == "aws-durable-execution-sdk-js-testing" || "$package_dir" == "aws-durable-execution-sdk-js" ]]; then
31+
cd "$package_dir"
32+
echo "Publishing package in $package_dir"
33+
npm publish --access public # Adjust --access as needed
34+
cd - # Go back to the root directory
35+
fi
36+
done
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)