瀏覽代碼

chore: Publish and install fix 8

Michael Bromley 2 年之前
父節點
當前提交
f0a0e5d626
共有 2 個文件被更改,包括 14 次插入5 次删除
  1. 13 4
      .github/workflows/publish_and_install.yml
  2. 1 1
      .github/workflows/verdaccio/config.yaml

+ 13 - 4
.github/workflows/publish_and_install.yml

@@ -16,6 +16,9 @@ defaults:
     shell: bash
 jobs:
   publish_install:
+    services:
+      verdaccio:
+        image: ./verdaccio/Dockerfile
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
@@ -33,32 +36,38 @@ jobs:
         npm install -g verdaccio
         npm install -g wait-on
         tmp_registry_log=`mktemp`
-        nohup verdaccio &>$tmp_registry_log &
+        mkdir -p $HOME/.config/verdaccio
+        cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
+        nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
         wait-on http://localhost:4873
         TOKEN_RES=$(curl -XPUT \
           -H "Content-type: application/json" \
           -d '{ "name": "test", "password": "test" }' \
           'http://localhost:4873/-/user/org.couchdb.user:test')
         TOKEN=$(echo "$TOKEN_RES" | jq -r '.token')
-        npm set registry "http://0.0.0.0:4873"
-        npm set //0.0.0.0:4873/:_authToken $TOKEN
+        npm set //localhost:4873/:_authToken $TOKEN
     - name: Windows dependencies
       if: matrix.os == 'windows-latest'
       run: npm install -g @angular/cli
     - name: Yarn install
       run: |
+        npm i -g yarn
         yarn config set unsafe-perm true
         yarn install --network-timeout 1000000 --prefer-offline
       env:
         CI: true
     - name: Publish to Verdaccio
       run: |
+        nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
+        wait-on http://localhost:4873
         yarn lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://localhost:4873
     - name: Install via @vendure/create
       run: |
         mkdir -p $HOME/install
         cd $HOME/install
-        npm set registry=http://0.0.0.0:4873
+        nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
+        wait-on http://localhost:4873
+        npm set registry=http://localhost:4873
         npm dist-tag ls @vendure/create
         npx @vendure/create@ci test-app --ci --use-npm --log-level info
     - name: Server smoke tests

+ 1 - 1
.github/workflows/verdaccio/config.yaml

@@ -10,7 +10,7 @@ plugins: ./plugins
 max_body_size: 1000mb
 web:
   # WebUI is enabled as default, if you want disable it, just uncomment this line
-  enable: false
+  enable: true
   title: Verdaccio
 
 auth: