Skip to content

Commit 429cf37

Browse files
ashwinkumar6Ashwin Kumarashika112
authored
chore(ci): replace npm-cli-adduser with native npm config (#14273)
* chore(ci): replace npm-cli-adduser with native npm config * chore(ci): remove pinned node version * chore(ci): use latest verdaccio stable version --------- Co-authored-by: Ashwin Kumar <[email protected]> Co-authored-by: ashika112 <[email protected]>
1 parent 81afde8 commit 429cf37

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/actions/load-verdaccio-with-amplify-js/action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
steps:
77
- name: Start verdaccio
88
run: |
9-
npx verdaccio@5.25.0 &
9+
npx verdaccio@6.0.5 &
1010
while ! nc -z localhost 4873; do
1111
echo "Verdaccio not running yet"
1212
sleep 1
@@ -15,17 +15,22 @@ runs:
1515
# Run your commands after verdaccio is up and running
1616
echo "Verdaccio is up and running, proceeding with the script..."
1717
shell: bash
18-
- name: Install and run npm-cli-login
18+
- name: Authenticate with Verdaccio
1919
shell: bash
2020
env:
2121
NPM_REGISTRY: http://localhost:4873/
2222
NPM_USER: verdaccio
2323
NPM_PASS: verdaccio
2424
NPM_EMAIL: [email protected]
2525
run: |
26-
npm i -g npm-cli-adduser
27-
npm-cli-adduser
28-
sleep 1
26+
TOKEN=$(curl -X PUT \
27+
-H "Content-Type: application/json" \
28+
-d "{\"name\": \"$NPM_USER\", \"password\": \"$NPM_PASS\"}" \
29+
$NPM_REGISTRY-/user/org.couchdb.user:$NPM_USER | jq -r '.token')
30+
31+
echo "registry=$NPM_REGISTRY
32+
//localhost:4873/:_authToken=$TOKEN" > ~/.npmrc
33+
2934
- name: Configure registry and git
3035
shell: bash
3136
working-directory: ./amplify-js

.github/actions/node-and-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
- name: Setup Node.js 18
1111
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
1212
with:
13-
node-version: 18.20.2
13+
node-version: 18
1414
env:
1515
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
1616
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0

0 commit comments

Comments
 (0)