From 7742f5285852651e8b2189b081ef2e6ed90fb2bd Mon Sep 17 00:00:00 2001 From: umignon Date: Wed, 11 Jun 2025 23:46:18 +0200 Subject: [PATCH 01/13] ci(deserializer): update npm publishing workflow to use new tag input --- .../workflows/publish-npm-deserializer.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index b63d67153..fd57b24f7 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -13,27 +13,16 @@ on: default: nightly jobs: - set-env: - runs-on: ubuntu-latest - outputs: - resolved-environment: ${{ steps.setenv.outputs.env }} - steps: - - id: setenv - run: | - if [ "${{ github.event.inputs.tag }}" = "latest" ]; then - echo "env=production" >> $GITHUB_OUTPUT - else - echo "env=staging" >> $GITHUB_OUTPUT - fi - publish-npm: needs: set-env - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.3.0 + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm with: scope: '@iexec/deserializer' registry: 'https://registry.npmjs.org' node-version: '18' - environment: ${{ needs.set-env.outputs.resolved-environment }} + tag: ${{ github.event.inputs.tag }} + install-command: 'npm ci && npm run test:prepare' + environment: ${{ needs.set-env.outputs.resolved-environment }} # For secrets env working-directory: "packages/dataprotector-deserializer" secrets: npm-token: ${{ secrets.NPM_TOKEN }} From 3dc6a897f65acadde716bc27c0db81dce7a5c033 Mon Sep 17 00:00:00 2001 From: umignon Date: Wed, 11 Jun 2025 23:55:04 +0200 Subject: [PATCH 02/13] ci(deserializer): add build step for SDK in npm publishing workflow --- .github/workflows/publish-npm-deserializer.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index fd57b24f7..5543365ae 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -13,8 +13,24 @@ on: default: nightly jobs: + build-sdk: + runs-on: ubuntu-latest + container: node:18 + steps: + - uses: actions/checkout@v4 + - name: Set up sdk + working-directory: packages/sdk + run: | + npm ci + npm run codegen + npm run build + - uses: actions/upload-artifact@v4 + with: + name: sdk-dist + path: packages/sdk/dist + publish-npm: - needs: set-env + needs: [build-sdk] uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm with: scope: '@iexec/deserializer' From 58a4cda42e34c86bfc50764c9a9d3a87ec4d742f Mon Sep 17 00:00:00 2001 From: Ugo Mignon <56931733+TartanLeGrand@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:13:58 +0200 Subject: [PATCH 03/13] fix: remove tests --- .github/workflows/publish-npm-deserializer.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 5543365ae..e4c45f0e2 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -37,7 +37,6 @@ jobs: registry: 'https://registry.npmjs.org' node-version: '18' tag: ${{ github.event.inputs.tag }} - install-command: 'npm ci && npm run test:prepare' environment: ${{ needs.set-env.outputs.resolved-environment }} # For secrets env working-directory: "packages/dataprotector-deserializer" secrets: From 2054742c74970e0c62c2e2e8c8a317c8edcc51ea Mon Sep 17 00:00:00 2001 From: Ugo Mignon <56931733+TartanLeGrand@users.noreply.github.com> Date: Thu, 12 Jun 2025 20:25:49 +0200 Subject: [PATCH 04/13] fix: ci artifacts --- .github/workflows/publish-npm-deserializer.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index e4c45f0e2..0c7f1cedc 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -39,5 +39,7 @@ jobs: tag: ${{ github.event.inputs.tag }} environment: ${{ needs.set-env.outputs.resolved-environment }} # For secrets env working-directory: "packages/dataprotector-deserializer" + artifact-name: 'sdk-dist' + artifact-path: 'packages/sdk/dist' secrets: npm-token: ${{ secrets.NPM_TOKEN }} From 9d2c0d6672edba9d654dd71b7f11ef0082c61916 Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 01:52:41 +0200 Subject: [PATCH 05/13] fix: add npm run test:prepare to ci --- .github/workflows/publish-npm-deserializer.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 0c7f1cedc..7c9fe0fe7 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -41,5 +41,8 @@ jobs: working-directory: "packages/dataprotector-deserializer" artifact-name: 'sdk-dist' artifact-path: 'packages/sdk/dist' + install-command: | + npm ci + npm run test:prepare secrets: npm-token: ${{ secrets.NPM_TOKEN }} From 7ce5af5a70e0cf3c430619329e6c51c89366bfcf Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 02:14:10 +0200 Subject: [PATCH 06/13] fix: use the same workspace --- .../workflows/publish-npm-deserializer.yml | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 7c9fe0fe7..b2bf517a2 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -13,36 +13,31 @@ on: default: nightly jobs: - build-sdk: + build-and-publish: runs-on: ubuntu-latest container: node:18 steps: - uses: actions/checkout@v4 + + # Build the SDK - name: Set up sdk working-directory: packages/sdk run: | npm ci npm run codegen npm run build - - uses: actions/upload-artifact@v4 + + - name: Publish deserializer package + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm with: - name: sdk-dist - path: packages/sdk/dist - - publish-npm: - needs: [build-sdk] - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm - with: - scope: '@iexec/deserializer' - registry: 'https://registry.npmjs.org' - node-version: '18' - tag: ${{ github.event.inputs.tag }} - environment: ${{ needs.set-env.outputs.resolved-environment }} # For secrets env - working-directory: "packages/dataprotector-deserializer" - artifact-name: 'sdk-dist' - artifact-path: 'packages/sdk/dist' - install-command: | - npm ci - npm run test:prepare - secrets: - npm-token: ${{ secrets.NPM_TOKEN }} + scope: '@iexec/deserializer' + registry: 'https://registry.npmjs.org' + node-version: '18' + tag: ${{ github.event.inputs.tag }} + environment: production + working-directory: "packages/dataprotector-deserializer" + install-command: | + npm ci + npm run test:prepare + secrets: + npm-token: ${{ secrets.NPM_TOKEN }} From 8e128564e9e7dac1c7bdec1c32afd3e14723c848 Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 02:19:25 +0200 Subject: [PATCH 07/13] fix: build --- .../workflows/publish-npm-deserializer.yml | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index b2bf517a2..911893635 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -13,31 +13,44 @@ on: default: nightly jobs: - build-and-publish: + build-sdk: runs-on: ubuntu-latest - container: node:18 steps: - uses: actions/checkout@v4 - - # Build the SDK - - name: Set up sdk + - name: Build sdk working-directory: packages/sdk run: | npm ci npm run codegen npm run build - - - name: Publish deserializer package - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm + - name: Upload sdk dist + uses: actions/upload-artifact@v4 + with: + name: sdk-dist + path: packages/sdk/dist + + publish-npm: + needs: build-sdk + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download sdk dist + uses: actions/download-artifact@v4 with: - scope: '@iexec/deserializer' - registry: 'https://registry.npmjs.org' - node-version: '18' - tag: ${{ github.event.inputs.tag }} - environment: production - working-directory: "packages/dataprotector-deserializer" - install-command: | - npm ci - npm run test:prepare - secrets: - npm-token: ${{ secrets.NPM_TOKEN }} + name: sdk-dist + path: packages/sdk/dist + + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm + with: + scope: '@iexec/deserializer' + registry: 'https://registry.npmjs.org' + node-version: '18' + tag: ${{ github.event.inputs.tag }} + environment: production + working-directory: "packages/dataprotector-deserializer" + install-command: | + npm ci + npm run test:prepare + secrets: + npm-token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 71c58060cde0c894ed26acfb0e0026acf5045dd4 Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 02:22:11 +0200 Subject: [PATCH 08/13] fix: use prepare workspace --- .../workflows/publish-npm-deserializer.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 911893635..e48b01fc8 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -17,37 +17,47 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build sdk + - name: Build SDK working-directory: packages/sdk run: | npm ci npm run codegen npm run build - - name: Upload sdk dist + - name: Upload sdk/dist uses: actions/upload-artifact@v4 with: name: sdk-dist path: packages/sdk/dist - publish-npm: + prepare-workspace: needs: build-sdk runs-on: ubuntu-latest + outputs: + environment: ${{ steps.set-env.outputs.resolved-environment }} steps: - uses: actions/checkout@v4 - - name: Download sdk dist + - name: Download sdk/dist uses: actions/download-artifact@v4 with: name: sdk-dist path: packages/sdk/dist + - name: Upload full workspace + uses: actions/upload-artifact@v4 + with: + name: full-workspace + path: . + + publish-npm: + needs: prepare-workspace uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm with: scope: '@iexec/deserializer' registry: 'https://registry.npmjs.org' node-version: '18' tag: ${{ github.event.inputs.tag }} - environment: production + environment: ${{ needs.prepare-workspace.outputs.environment }} working-directory: "packages/dataprotector-deserializer" install-command: | npm ci From 430d65e2d0c07a77890a813fce31e3e7e6d1b4c0 Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 02:29:20 +0200 Subject: [PATCH 09/13] fix: remove unecessary build steps and use build with the reusable workflow --- .../workflows/publish-npm-deserializer.yml | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index e48b01fc8..84b141160 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -13,42 +13,6 @@ on: default: nightly jobs: - build-sdk: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build SDK - working-directory: packages/sdk - run: | - npm ci - npm run codegen - npm run build - - name: Upload sdk/dist - uses: actions/upload-artifact@v4 - with: - name: sdk-dist - path: packages/sdk/dist - - prepare-workspace: - needs: build-sdk - runs-on: ubuntu-latest - outputs: - environment: ${{ steps.set-env.outputs.resolved-environment }} - steps: - - uses: actions/checkout@v4 - - - name: Download sdk/dist - uses: actions/download-artifact@v4 - with: - name: sdk-dist - path: packages/sdk/dist - - - name: Upload full workspace - uses: actions/upload-artifact@v4 - with: - name: full-workspace - path: . - publish-npm: needs: prepare-workspace uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm @@ -61,6 +25,11 @@ jobs: working-directory: "packages/dataprotector-deserializer" install-command: | npm ci + cd ../sdk + npm ci + npm run codegen + npm run build + cd ../dataprotector-deserializer npm run test:prepare secrets: npm-token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 56dfc221caeebd77cf91de0570b7a1719b91c3eb Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Fri, 13 Jun 2025 02:33:53 +0200 Subject: [PATCH 10/13] fix: indentation --- .github/workflows/publish-npm-deserializer.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 84b141160..99261264a 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -14,14 +14,13 @@ on: jobs: publish-npm: - needs: prepare-workspace uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm with: scope: '@iexec/deserializer' registry: 'https://registry.npmjs.org' node-version: '18' tag: ${{ github.event.inputs.tag }} - environment: ${{ needs.prepare-workspace.outputs.environment }} + environment: production working-directory: "packages/dataprotector-deserializer" install-command: | npm ci From a98396a2ed4c87c4cc01772f8cd733a39ae1d657 Mon Sep 17 00:00:00 2001 From: Ugo Date: Mon, 16 Jun 2025 10:06:22 +0200 Subject: [PATCH 11/13] fix: add set-publish-version job to manage versioning for nightly and default tags --- .../workflows/publish-npm-deserializer.yml | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 99261264a..8f8e87949 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -10,11 +10,35 @@ on: options: - latest - nightly + - beta default: nightly jobs: + set-publish-version: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + - name: Set publish version + id: set-publish-version + if: github.event.inputs.tag == 'nightly' + working-directory: packages/sdk + run: | + if [ "${{ github.event.inputs.tag }}" == "nightly" ]; then + CURRENT_VERSION=$(npm pkg get version | tr -d '"') + NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}" + echo "VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT + else + echo "VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT + fi + outputs: + VERSION: ${{ steps.set-publish-version.outputs.VERSION }} + publish-npm: uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm + needs: set-publish-version with: scope: '@iexec/deserializer' registry: 'https://registry.npmjs.org' @@ -22,6 +46,7 @@ jobs: tag: ${{ github.event.inputs.tag }} environment: production working-directory: "packages/dataprotector-deserializer" + version: ${{ needs.set-publish-version.outputs.VERSION }} install-command: | npm ci cd ../sdk @@ -31,4 +56,4 @@ jobs: cd ../dataprotector-deserializer npm run test:prepare secrets: - npm-token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + npm-token: ${{ secrets.NPM_TOKEN }} From f6c72d0aacd785c2b5a484bd0743d4664915604e Mon Sep 17 00:00:00 2001 From: Ugo Date: Mon, 16 Jun 2025 10:08:49 +0200 Subject: [PATCH 12/13] fix: update workflow name for clarity in publish-npm-deserializer --- .github/workflows/publish-npm-deserializer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index 8f8e87949..d40888f5e 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -1,4 +1,4 @@ -name: Publish Package NPM +name: Publish Package NPM - Deserializer on: workflow_dispatch: From ca259d35f2a48ad5d03464ab8103f200896be589 Mon Sep 17 00:00:00 2001 From: Ugo Date: Mon, 16 Jun 2025 10:14:20 +0200 Subject: [PATCH 13/13] fix: update publish-npm workflow reference to version 1.4.0 --- .github/workflows/publish-npm-deserializer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml index d40888f5e..9042f16da 100644 --- a/.github/workflows/publish-npm-deserializer.yml +++ b/.github/workflows/publish-npm-deserializer.yml @@ -37,7 +37,7 @@ jobs: VERSION: ${{ steps.set-publish-version.outputs.VERSION }} publish-npm: - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@feat/publish-npm + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.4.0 needs: set-publish-version with: scope: '@iexec/deserializer'