From 8effd77eef96d7348e106901aca1d7f70740728f Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:08:57 +0200 Subject: [PATCH 1/6] feat: add publish-orders workflow for managing sell orders --- .github/workflows/publish-orders.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/publish-orders.yml diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml new file mode 100644 index 00000000..1d636e68 --- /dev/null +++ b/.github/workflows/publish-orders.yml @@ -0,0 +1,51 @@ +name: publish-orders + +on: + workflow_dispatch: + inputs: + environment: + description: 'Target environment' + required: true + type: choice + options: + # dev environments + - bellecour-dev + - arbitrum-sepolia-dev + # prod environments + - bellecour-prod + - arbitrum-sepolia-prod + - arbitrum-prod + action: + description: 'Order action' + required: true + type: choice + options: + - publish-sell-order + - revoke-sell-order + +jobs: + publish-order: + runs-on: ubuntu-latest + environment: ${{ inputs.environment }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.19.0' + cache: 'npm' + + - name: Install dependencies + working-directory: deployment-dapp + run: npm ci + + - name: Execute order action + working-directory: deployment-dapp + env: + WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }} + PRICE: ${{ vars.SELL_ORDER_PRICE }} + VOLUME: ${{ vars.SELL_ORDER_VOLUME }} + RPC_URL: ${{ secrets.RPC_URL }} + run: npm run ${{ github.event.inputs.action }} \ No newline at end of file From 78e6d1968c70a293b5ffaa22724fa55b40c9a166 Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:09:04 +0200 Subject: [PATCH 2/6] chore: ensure newline at end of file in publish-orders workflow --- .github/workflows/publish-orders.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml index 1d636e68..3dc19597 100644 --- a/.github/workflows/publish-orders.yml +++ b/.github/workflows/publish-orders.yml @@ -48,4 +48,4 @@ jobs: PRICE: ${{ vars.SELL_ORDER_PRICE }} VOLUME: ${{ vars.SELL_ORDER_VOLUME }} RPC_URL: ${{ secrets.RPC_URL }} - run: npm run ${{ github.event.inputs.action }} \ No newline at end of file + run: npm run ${{ github.event.inputs.action }} From aa2854a31fd4239e3bc89ddc51d8de31733200b9 Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:11:13 +0200 Subject: [PATCH 3/6] fix: remove action input from publish-orders workflow and hardcode publish-sell-order --- .github/workflows/publish-orders.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml index 3dc19597..b15bb6e8 100644 --- a/.github/workflows/publish-orders.yml +++ b/.github/workflows/publish-orders.yml @@ -15,13 +15,6 @@ on: - bellecour-prod - arbitrum-sepolia-prod - arbitrum-prod - action: - description: 'Order action' - required: true - type: choice - options: - - publish-sell-order - - revoke-sell-order jobs: publish-order: @@ -48,4 +41,4 @@ jobs: PRICE: ${{ vars.SELL_ORDER_PRICE }} VOLUME: ${{ vars.SELL_ORDER_VOLUME }} RPC_URL: ${{ secrets.RPC_URL }} - run: npm run ${{ github.event.inputs.action }} + run: npm run publish-sell-order From 75e7183285b5a802a2937f0f8652e5344ec171df Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:18:07 +0200 Subject: [PATCH 4/6] feat: add app_address input to publish-orders workflow for order publishing --- .github/workflows/publish-orders.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml index b15bb6e8..6dcbf7c2 100644 --- a/.github/workflows/publish-orders.yml +++ b/.github/workflows/publish-orders.yml @@ -15,6 +15,10 @@ on: - bellecour-prod - arbitrum-sepolia-prod - arbitrum-prod + app_address: + description: 'App address to publish orders for' + required: true + type: string jobs: publish-order: @@ -34,6 +38,10 @@ jobs: working-directory: deployment-dapp run: npm ci + - name: Create app address file + working-directory: deployment-dapp + run: echo "${{ github.event.inputs.app_address }}" > .app-address + - name: Execute order action working-directory: deployment-dapp env: From 25c626af734c3c11fcf73230aa66dafb42467dd9 Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:18:49 +0200 Subject: [PATCH 5/6] chore: add TODO comment to verify app address ownership in publish-orders workflow --- .github/workflows/publish-orders.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml index 6dcbf7c2..3a013db2 100644 --- a/.github/workflows/publish-orders.yml +++ b/.github/workflows/publish-orders.yml @@ -42,6 +42,8 @@ jobs: working-directory: deployment-dapp run: echo "${{ github.event.inputs.app_address }}" > .app-address + + # TODO: Check WEB3MAIL_APP_OWNER_PRIVATEKEY is the owner of the app address set as input - name: Execute order action working-directory: deployment-dapp env: From bfad1b1ad03dbef61ad592577f62b482c778de99 Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 16 Oct 2025 18:26:12 +0200 Subject: [PATCH 6/6] chore: add TODO comment to migrate to vars in publish-orders workflow --- .github/workflows/publish-orders.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-orders.yml b/.github/workflows/publish-orders.yml index 3a013db2..f598d801 100644 --- a/.github/workflows/publish-orders.yml +++ b/.github/workflows/publish-orders.yml @@ -37,7 +37,8 @@ jobs: - name: Install dependencies working-directory: deployment-dapp run: npm ci - + + # TODO: Migrate to a github workflow using vars instead of app-address files - name: Create app address file working-directory: deployment-dapp run: echo "${{ github.event.inputs.app_address }}" > .app-address