Skip to content

Commit

Permalink
ci(test-publish): fix verdaccio
Browse files Browse the repository at this point in the history
by docker compose
  • Loading branch information
jjangga0214 committed Sep 10, 2024
1 parent 0707653 commit dba82a8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 1,472 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/test-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 20]
node-version: [18, 20, 22]
os: [ubuntu-latest, macOS-latest, windows-latest, windows-2019]

steps:
Expand All @@ -84,14 +84,7 @@ jobs:
# verdaccio is private npm registry. [link](https://github.com/verdaccio/verdaccio/)
if: startsWith(matrix.os, 'windows') == false # use an operrator "==" as "!startsWith(matrix.os, 'windows')" causes an error
run: |
# trailing `&` detaches process from foreground
pnpm verdaccio &
- name: Run Local Npm Registry (Verdaccio) On Windows
if: startsWith(matrix.os, 'windows')
run: |
pnpm add --global forever
forever start node_modules\verdaccio\bin\verdaccio --config ./verdaccio/conf/default.yaml
docker compose -f verdaccio/docker-compose.yaml up --wait
- name: Publish To Local NPM Registry
run: |
Expand All @@ -101,8 +94,9 @@ jobs:
# and can be substituted by setting `_authToken`.
# By local verdaccio setting(verdaccio/conf/default.yaml),
# the _authToken can be any random string,
# and anyone can publish hasura-cli.
# and verdaccio is configured to allowing anyone to publish `hasura-cli`.
npm config set //localhost:4873/:_authToken helloworld
npm run prepublishOnly
npm publish --registry http://localhost:4873
- name: Test Installation
Expand Down Expand Up @@ -138,7 +132,7 @@ jobs:
- name: Build and Publish
# only runs if name of git tag starts with 'v1.' and on branch master
run: |
pnpm build # to prevent a mistake though there is already prepublishOnly lifecycle hook.
pnpm run prepublishOnly # to prevent a mistake though there is already prepublishOnly lifecycle hook.
pnpm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ junit.xml
dist
hasura.dev
tsconfig.tsbuildinfo
verdaccio/**/*
!verdaccio/conf/default.yaml

**/.DS_Store
# Created by https://www.gitignore.io/api/node,intellij+all,visualstudiocode
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.3.3",
"upath": "^2.0.1",
"verdaccio": "^4.3.0"
"upath": "^2.0.1"
},
"dependencies": {
"axios": "^1.6.0",
Expand Down
Loading

0 comments on commit dba82a8

Please sign in to comment.