From 1c5f7ccd37550460d0699f9c10d3ed724a00baa3 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 15 May 2025 05:14:39 +0000 Subject: [PATCH 1/4] chore: update sdk preview workflow to be generic --- .github/workflows/sdk-preview.yml | 36 ++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index 92b4f454cb..671dd64589 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -1,25 +1,45 @@ -name: "Console SDK Preview" +name: "SDK Preview" on: pull_request: - paths: - - 'app/config/specs/*-latest-console.json' - + workflow_dispatch: + inputs: + platform: + type: choice + description: "Platform to build" + options: + - client + - console + - server jobs: setup: - name: Setup & Build Console SDK + name: Setup & Build SDK runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 + + - name: Set SDK type + id: set-sdk + run: | + PLATFORM="${{ github.event.inputs.platform }}" + if [ -z "$PLATFORM" ]; then + PLATFORM="console" + fi + if [ "$PLATFORM" = "server" ]; then + echo "sdk_type=nodejs" >> $GITHUB_OUTPUT + else + echo "sdk_type=web" >> $GITHUB_OUTPUT + fi + echo "platform=$PLATFORM" >> $GITHUB_OUTPUT - name: Load and Start Appwrite run: | docker compose build docker compose up -d - docker compose exec appwrite sdks --platform=console --sdk=web --version=latest --git=no - sudo chown -R $USER:$USER ./app/sdks/console-web + docker compose exec appwrite sdks --platform=${{ steps.set-sdk.outputs.platform }} --sdk=${{ steps.set-sdk.outputs.sdk_type }} --version=latest --git=no + sudo chown -R $USER:$USER ./app/sdks/${{ steps.set-sdk.outputs.platform }}-${{ steps.set-sdk.outputs.sdk_type }} - uses: actions/setup-node@v4 with: @@ -30,4 +50,4 @@ jobs: run: | npm install npm run build - npx pkg-pr-new publish --comment=update + npx pkg-pr-new publish --comment=update \ No newline at end of file From 403a2e9db3953aa1c4088a512b1de127721bf548 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 15 May 2025 05:17:57 +0000 Subject: [PATCH 2/4] chore: whitespace --- .github/workflows/sdk-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index 671dd64589..e1bc99c7e9 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -50,4 +50,4 @@ jobs: run: | npm install npm run build - npx pkg-pr-new publish --comment=update \ No newline at end of file + npx pkg-pr-new publish --comment=update From e1e6b82ca35a6c284358a95f8e3b7a58db8770be Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 15 May 2025 05:22:48 +0000 Subject: [PATCH 3/4] chore: remove on pull request --- .github/workflows/sdk-preview.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index e1bc99c7e9..b90b9dee97 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -1,7 +1,6 @@ name: "SDK Preview" on: - pull_request: workflow_dispatch: inputs: platform: From f8186076806f0746e07681f4bb59ae72d0ff4bd9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 15 May 2025 05:27:43 +0000 Subject: [PATCH 4/4] chore: keep console sdk preview automatic --- .github/workflows/sdk-preview.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index b90b9dee97..e317845768 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -1,6 +1,9 @@ name: "SDK Preview" on: + pull_request: + paths: + - 'app/config/specs/*-latest-console.json' workflow_dispatch: inputs: platform: @@ -8,7 +11,6 @@ on: description: "Platform to build" options: - client - - console - server jobs: