From 5e6746c1b6f04dd27a3c8f7e5f5eb0b678e06c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Cortier?= <3809077+CBenoit@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:00:13 +0200 Subject: [PATCH] ci(npm-publish): update workflow (#746) --- .github/workflows/npm-publish.yml | 28 ++++++++++++++++++--- web-client/iron-remote-desktop/package.json | 5 ++-- web-client/iron-svelte-client/pre-build.js | 5 ++-- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index af3dd527..d204e518 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -32,11 +32,18 @@ jobs: } build: - name: Build package + name: Build package [${{matrix.library}}] runs-on: ubuntu-latest needs: - preflight + strategy: + fail-fast: false + matrix: + library: + - iron-remote-desktop + - iron-remote-desktop-rdp + steps: - name: Checkout uses: actions/checkout@v4 @@ -49,7 +56,7 @@ jobs: - name: Install dependencies shell: pwsh run: | - Set-Location -Path ./web-client/iron-remote-gui/ + Set-Location -Path "./web-client/${{matrix.library}}/" npm install - name: Build package @@ -57,7 +64,7 @@ jobs: run: | Set-PSDebug -Trace 1 - Set-Location -Path ./web-client/iron-remote-gui/ + Set-Location -Path "./web-client/${{matrix.library}}/" npm run build Set-Location -Path ./dist npm pack @@ -73,9 +80,22 @@ jobs: - name: Upload package artifact uses: actions/upload-artifact@v4 with: - name: npm + name: npm-${{matrix.library}} path: npm-packages/*.tgz + nuget-merge: + name: Merge artifacts + runs-on: ubuntu-latest + needs: build + + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: npm + pattern: npm-* + delete-merged: true + publish: name: Publish package runs-on: ubuntu-latest diff --git a/web-client/iron-remote-desktop/package.json b/web-client/iron-remote-desktop/package.json index 8478009a..8d36a9d0 100644 --- a/web-client/iron-remote-desktop/package.json +++ b/web-client/iron-remote-desktop/package.json @@ -13,9 +13,8 @@ "type": "module", "private": true, "scripts": { - "dev": "npm run vite", - "build": "npm run vite build", - "build-alone": "vite build", + "dev": "vite", + "build": "vite build", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json", "check:dist": "tsc ./dist/index.d.ts --noEmit", diff --git a/web-client/iron-svelte-client/pre-build.js b/web-client/iron-svelte-client/pre-build.js index 122cb5ad..396d4299 100644 --- a/web-client/iron-svelte-client/pre-build.js +++ b/web-client/iron-svelte-client/pre-build.js @@ -57,11 +57,12 @@ const copyCoreFiles = async () => { } }; +await run('npm run build', '../iron-remote-desktop'); + let buildCommand = 'npm run build'; if (noWasm) { buildCommand = 'npm run build-alone'; } - -await run(buildCommand, '../iron-remote-desktop'); await run(buildCommand, '../iron-remote-desktop-rdp'); + await copyCoreFiles();