Skip to content

Commit

Permalink
fix npm (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyNikiforov authored Apr 12, 2024
1 parent d5dd98a commit b87d349
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 48 deletions.
107 changes: 59 additions & 48 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,9 @@ jobs:
- name: Publish NPM
if: steps.get_image.outputs.digest != ''
run: |
npm publish dist/npm/@icloudpd/linux-arm --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-arm64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-ia32 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/win32-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/darwin-x64 --access public --registry http://localhost:4873
Expand Down Expand Up @@ -1642,6 +1645,9 @@ jobs:
- name: Publish NPM
if: steps.get_image.outputs.digest != ''
run: |
npm publish dist/npm/@icloudpd/linux-arm --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-arm64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-ia32 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/win32-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/darwin-x64 --access public --registry http://localhost:4873
Expand Down Expand Up @@ -1684,7 +1690,6 @@ jobs:
compatibility_macos_npm:
if: false
name: "Compatibility NPM on ${{ matrix.prop[0] }} on ${{ matrix.prop[1] }} platform"
strategy:
fail-fast: false
Expand Down Expand Up @@ -1714,14 +1719,10 @@ jobs:

steps:

- name: Setup Node
if: steps.get_image.outputs.digest != ''
- name: Setup Node for Registry Server
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'http://0.0.0.0:4873'
env:
NODE_AUTH_TOKEN: "fake"

- name: Create Config
run: |
Expand All @@ -1730,16 +1731,22 @@ jobs:
echo "
storage: ${{ github.workspace }}/verdaccio
max_body_size: 1000mb
log: { type: stdout, format: pretty, level: http }
log: { type: file, format: plain, level: http, path: ${{ github.workspace }}/verdaccio.log }
packages:
'**':
access: \$anonymous
publish: \$anonymous" > ${{ github.workspace }}/npm_config.yaml
publish: \$anonymous
listen:
- localhost:4873" > ${{ github.workspace }}/npm_config.yaml
cat ${{ github.workspace }}/npm_config.yaml
- name: Install Registry
shell: bash
run: npm install -g verdaccio@5

- name: Start Registry
shell: bash
run: (npx -y verdaccio@5 --config ${{ github.workspace }}/npm_config.yaml --listen 0.0.0.0:4873 > ${{ github.workspace }}/verdaccio.log) &
run: verdaccio --config ${{ github.workspace }}/npm_config.yaml &

- name: Make folder for compatibility
run: |
Expand All @@ -1752,19 +1759,19 @@ jobs:
path: |
dist/npm
- name: Test Registry
run: |
echo "ls..."
ls -la
echo "ps..."
ps -ef | grep verdaccio
echo "log..."
cat ${{ github.workspace }}/verdaccio.log
echo "curl..."
curl -v http://0.0.0.0:4873
- name: Setup Node for Test
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'http://localhost:4873'
env:
NODE_AUTH_TOKEN: "fake"

- name: Publish NPM
run: |
npm publish dist/npm/@icloudpd/linux-arm --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-arm64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-ia32 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/win32-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/darwin-x64 --access public --registry http://localhost:4873
Expand All @@ -1778,7 +1785,7 @@ jobs:
continue-on-error: true
run: >
npx -y --registry http://localhost:4873 icloudpd@${{inputs.icloudpd_version}} --help &&
touch /work/compatibility/npm.${{ matrix.prop[0] }}.${{ matrix.prop[1] }}.pass
touch compatibility/npm.${{ matrix.prop[0] }}.${{ matrix.prop[1] }}.pass
- name: Record failure on ${{ matrix.prop[0] }}
if: ${{ steps.run_test.outcome == 'failure' }}
Expand All @@ -1795,12 +1802,13 @@ jobs:
compatibility_windows_npm:
if: false
name: "Compatibility NPM on ${{ matrix.os }} on amd64 platform"
strategy:
fail-fast: false
matrix:
os: [ "windows-2019", "windows-2022" ]
os:
- "windows-2019"
- "windows-2022"
runs-on: ${{ matrix.os }}
needs: [ build_npm ]
defaults:
Expand All @@ -1809,31 +1817,34 @@ jobs:

steps:

- name: Setup Node
if: steps.get_image.outputs.digest != ''
- name: Setup Node for Registry Server
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'http://localhost:4873'
env:
NODE_AUTH_TOKEN: "fake"

- name: Create Config
run: |
touch ${{ github.workspace }}/npm_config.yaml
mkdir ${{ github.workspace }}/verdaccio
touch npm_config.yaml
mkdir verdaccio
echo "
storage: ${{ github.workspace }}/verdaccio
storage: verdaccio
log: { type: file, format: plain, level: debug, path: verdaccio.log }
max_body_size: 1000mb
packages:
'**':
access: \$anonymous
publish: \$anonymous" > ${{ github.workspace }}/npm_config.yaml
cat ${{ github.workspace }}/npm_config.yaml
publish: \$anonymous
listen:
- localhost:4873" > npm_config.yaml
cat npm_config.yaml
- name: Install Registry
shell: bash
run: npm install -g verdaccio@5

- name: Start Registry
shell: bash
run: (npx -y verdaccio@5 --config ${{ github.workspace }}/npm_config.yaml --listen 0.0.0.0:4873 > ${{ github.workspace }}/verdaccio.log) &
run: verdaccio --config npm_config.yaml &

- name: Make folder for compatibility
run: |
Expand All @@ -1846,19 +1857,20 @@ jobs:
path: |
dist/npm
- name: Test Registry
run: |
echo "ls..."
ls -la
echo "ps..."
ps -ef | grep verdaccio
echo "log..."
cat ${{ github.workspace }}/verdaccio.log
echo "curl..."
curl -v http://localhost:4873
- name: Setup Node for Test
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'http://localhost:4873'
env:
NODE_AUTH_TOKEN: "fake"

- name: Publish NPM
continue-on-error: true
run: |
npm publish dist/npm/@icloudpd/linux-arm --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-arm64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-ia32 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/linux-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/win32-x64 --access public --registry http://localhost:4873
npm publish dist/npm/@icloudpd/darwin-x64 --access public --registry http://localhost:4873
Expand All @@ -1872,7 +1884,7 @@ jobs:
continue-on-error: true
run: >
npx -y --registry http://localhost:4873 icloudpd@${{inputs.icloudpd_version}} --help &&
touch /work/compatibility/npm.${{ matrix.os }}.amd64.pass
touch compatibility/npm.${{ matrix.os }}.amd64.pass
- name: Record failure on ${{ matrix.os }}
if: ${{ steps.run_test.outcome == 'failure' }}
Expand All @@ -1887,7 +1899,6 @@ jobs:
path: |
compatibility/*
compatibility_report:
name: "Build Compatibility Report"

Expand All @@ -1903,8 +1914,8 @@ jobs:
- compatibility_docker
- compatibility_linux_npm_apt
- compatibility_linux_npm_apk
# - compatibility_macos_npm
# - compatibility_windows_npm
- compatibility_macos_npm
- compatibility_windows_npm
defaults:
run:
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
- name: Publish NPM
run: |
npm publish dist/npm/@icloudpd/linux-arm --access public
npm publish dist/npm/@icloudpd/linux-arm64 --access public
npm publish dist/npm/@icloudpd/linux-ia32 --access public
npm publish dist/npm/@icloudpd/linux-x64 --access public
npm publish dist/npm/@icloudpd/win32-x64 --access public
npm publish dist/npm/@icloudpd/darwin-x64 --access public
Expand Down

0 comments on commit b87d349

Please sign in to comment.