From 0710bb9f406080bcb3f58d2bf11ccf6ecb4f2a0b Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:15:32 -0400 Subject: [PATCH 01/19] first draft of deploy-dev-build workflow --- .github/workflows/ci.yml | 1 + .github/workflows/deploy-dev-build.yml | 72 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/deploy-dev-build.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79a69597525..c73eabaa4dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -668,6 +668,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 name: Upload uncompressed plotly.js built from PR, using Node 22 with: + name: plotly.node22.js retention-days: 30 archive: false path: dist/plotly.node22.js diff --git a/.github/workflows/deploy-dev-build.yml b/.github/workflows/deploy-dev-build.yml new file mode 100644 index 00000000000..5b2ddbbc1c7 --- /dev/null +++ b/.github/workflows/deploy-dev-build.yml @@ -0,0 +1,72 @@ +name: Deploy dev build from PR + +on: + workflow_run: + workflows: ["CI"] # ci.yml + types: + - completed + +jobs: + deploy: + runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' + + steps: + - name: Download Build Artifact + id: download-artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + continue-on-error: true + with: + name: plotly.node22.js # uploaded by ci.yml > publish-dist-node-v22 + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + path: temp-dist + + - name: Check if Artifact Exists + if: steps.download-artifact.outcome != 'success' + run: | + echo "No build artifact found for this run. Skipping deployment." + exit 0 + + - name: Prepare Folder Structure + id: prepare-folder-structure + run: | + PR_NUM="${{ github.event.workflow_run.pull_requests[0].number }}" + SHA="${{ github.event.workflow_run.head_sha }}" + + mkdir -p "deploy/pr-$PR_NUM/$SHA" + mkdir -p "deploy/pr-$PR_NUM/latest" + + # Name of file must match name of file uploaded by ci.yml > publish-dist-node-v22 + cp temp-dist/plotly.node22.js "deploy/pr-$PR_NUM/$SHA/plotly.js" + cp temp-dist/plotly.node22.js "deploy/pr-$PR_NUM/latest/plotly.js" + + echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT + echo "SHA=$SHA" >> $GITHUB_OUTPUT + + - name: Generate GitHub App Token + id: generate-token + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 + with: + app-id: ${{ variables.DEV_DEPLOY_APP_ID }} + private-key: ${{ secrets.DEV_DEPLOY_APP_PRIVATE_KEY }} + owner: plotly + repositories: plotly.js-dev-builds + + - name: Deploy to plotly.js-dev-builds repo + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 + with: + repository-name: plotly/plotly.js-dev-builds + token: ${{ steps.generate-token.outputs.token }} # create-github-app-token action automatically outputs the token + branch: gh-pages + folder: deploy + target-folder: . + clean: false + + - name: Generate Summary + run: | + BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.prepare-folder-structure.outputs.PR_NUM }}" + echo "### PR Build Deployed" >> $GITHUB_STEP_SUMMARY + echo "Builds for PR #${{ steps.prepare-folder-structure.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY + echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY + echo "- [Immutable (this commit)]($BASE/${{ steps.prepare-folder-structure.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY From e37c181cda7f60e1906a4f03e4b656aac989e6a5 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:20:44 -0400 Subject: [PATCH 02/19] syntax --- .github/workflows/deploy-dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-dev-build.yml b/.github/workflows/deploy-dev-build.yml index 5b2ddbbc1c7..064e670aab2 100644 --- a/.github/workflows/deploy-dev-build.yml +++ b/.github/workflows/deploy-dev-build.yml @@ -48,7 +48,7 @@ jobs: id: generate-token uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 with: - app-id: ${{ variables.DEV_DEPLOY_APP_ID }} + app-id: ${{ vars.DEV_DEPLOY_APP_ID }} private-key: ${{ secrets.DEV_DEPLOY_APP_PRIVATE_KEY }} owner: plotly repositories: plotly.js-dev-builds From 70ab63b920726b64c5c251110b164868e4d5697d Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 30 Apr 2026 17:58:48 -0400 Subject: [PATCH 03/19] separate publish-dist into separate workflow --- .github/workflows/ci.yml | 118 --------------------- .github/workflows/deploy-dev-build.yml | 4 +- .github/workflows/publish-dist.yml | 137 +++++++++++++++++++++++++ 3 files changed, 139 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/publish-dist.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c73eabaa4dd..5785b12c9bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -575,124 +575,6 @@ jobs: # ============================================================ # Standalone jobs (no dependencies on install-and-cibuild) # ============================================================ - publish-dist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - fetch-tags: true - - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - - - name: Set up build environment - run: .github/scripts/env_build.sh - - - name: Preview CHANGELOG for next release (only on master) - if: github.ref == 'refs/heads/master' - run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true - - - name: Set draft version in package.json - run: | - node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" $(git describe) - - - name: View package.json diff between previous and next releases - run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true - - - name: Build dist/ - run: npm run build - - # Upload library uncompressed to allow for testing in REPLs - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - name: Upload uncompressed plotly.js built from PR, using Node 22 - with: - retention-days: 30 - archive: false - path: dist/plotly.js - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - name: Upload Node 18 archive of plotly.js build folder - with: - name: dist-node18 - retention-days: 7 - path: dist/ - - - name: View dist/README.md diff between previous and next releases - run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true - - - name: Preview plot-schema diff (only on master) - if: github.ref == 'refs/heads/master' - run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true - - - name: Test plot-schema.json diff - run: diff --unified --color dist/plot-schema.json test/plot-schema.json - - publish-dist-node-v22: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - fetch-tags: true - - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - with: - node-version: '22.14.0' - cache: 'npm' - - - name: Set up build environment - run: .github/scripts/env_build.sh - - - name: Preview CHANGELOG for next release (only on master) - if: github.ref == 'refs/heads/master' - run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true - - - name: Set draft version in package.json - run: | - node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" $(git describe) - - - name: View package.json diff between previous and next releases - run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true - - - name: Build dist/ - run: npm run build - - # This is necessary to avoid a naming collision with the upload from the Node 18 build - - name: Copy library for upload - run: cp dist/plotly.js dist/plotly.node22.js - - # Upload library uncompressed to allow for testing in REPLs - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - name: Upload uncompressed plotly.js built from PR, using Node 22 - with: - name: plotly.node22.js - retention-days: 30 - archive: false - path: dist/plotly.node22.js - - - name: Remove copy of library - run: rm dist/plotly.node22.js - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - name: Upload Node 22 archive of plotly.js build folder - with: - name: dist-node22 - retention-days: 7 - path: dist/ - - - name: View dist/README.md diff between previous and next releases - run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true - - - name: Preview plot-schema diff (only on master) - if: github.ref == 'refs/heads/master' - run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true - - - name: Test plot-schema.json diff - run: diff --unified --color dist/plot-schema.json test/plot-schema.json - test-stackgl-bundle: needs: detect-changes if: >- diff --git a/.github/workflows/deploy-dev-build.yml b/.github/workflows/deploy-dev-build.yml index 064e670aab2..5d66944c328 100644 --- a/.github/workflows/deploy-dev-build.yml +++ b/.github/workflows/deploy-dev-build.yml @@ -2,7 +2,7 @@ name: Deploy dev build from PR on: workflow_run: - workflows: ["CI"] # ci.yml + workflows: ["Publish Dist"] # publish-dist.yml types: - completed @@ -17,7 +17,7 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 continue-on-error: true with: - name: plotly.node22.js # uploaded by ci.yml > publish-dist-node-v22 + name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22 run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} path: temp-dist diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml new file mode 100644 index 00000000000..041eb06853b --- /dev/null +++ b/.github/workflows/publish-dist.yml @@ -0,0 +1,137 @@ +name: Publish Dist + +on: + push: + branches: [master] + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + +concurrency: + group: publish-dist-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + NODE_VERSION: '18' + +jobs: + publish-dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Set up build environment + run: .github/scripts/env_build.sh + + - name: Preview CHANGELOG for next release (only on master) + if: github.ref == 'refs/heads/master' + run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true + + - name: Set draft version in package.json + run: | + node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" $(git describe) + + - name: View package.json diff between previous and next releases + run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true + + - name: Build dist/ + run: npm run build + + # Upload library uncompressed to allow for testing in REPLs + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + name: Upload uncompressed plotly.js built from PR, using Node 22 + with: + retention-days: 30 + archive: false + path: dist/plotly.js + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + name: Upload Node 18 archive of plotly.js build folder + with: + name: dist-node18 + retention-days: 7 + path: dist/ + + - name: View dist/README.md diff between previous and next releases + run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true + + - name: Preview plot-schema diff (only on master) + if: github.ref == 'refs/heads/master' + run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true + + - name: Test plot-schema.json diff + run: diff --unified --color dist/plot-schema.json test/plot-schema.json + + publish-dist-node-v22: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version: '22.14.0' + cache: 'npm' + + - name: Set up build environment + run: .github/scripts/env_build.sh + + - name: Preview CHANGELOG for next release (only on master) + if: github.ref == 'refs/heads/master' + run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true + + - name: Set draft version in package.json + run: | + node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" $(git describe) + + - name: View package.json diff between previous and next releases + run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true + + - name: Build dist/ + run: npm run build + + # This is necessary to avoid a naming collision with the upload from the Node 18 build + - name: Copy library for upload + run: cp dist/plotly.js dist/plotly.node22.js + + # Upload library uncompressed to allow for testing in REPLs + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + name: Upload uncompressed plotly.js built from PR, using Node 22 + with: + name: plotly.node22.js + retention-days: 30 + archive: false + path: dist/plotly.node22.js + + - name: Remove copy of library + run: rm dist/plotly.node22.js + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + name: Upload Node 22 archive of plotly.js build folder + with: + name: dist-node22 + retention-days: 7 + path: dist/ + + - name: View dist/README.md diff between previous and next releases + run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true + + - name: Preview plot-schema diff (only on master) + if: github.ref == 'refs/heads/master' + run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true + + - name: Test plot-schema.json diff + run: diff --unified --color dist/plot-schema.json test/plot-schema.json From 852bda45b3676893a60c13cf800156ac3dd58cd2 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 10:24:59 -0400 Subject: [PATCH 04/19] rename workflow --- .github/workflows/deploy-dev-build.yml | 72 -------------------------- .github/workflows/upload-dev-build.yml | 69 +++++++++++++++++++++--- 2 files changed, 62 insertions(+), 79 deletions(-) delete mode 100644 .github/workflows/deploy-dev-build.yml diff --git a/.github/workflows/deploy-dev-build.yml b/.github/workflows/deploy-dev-build.yml deleted file mode 100644 index 5d66944c328..00000000000 --- a/.github/workflows/deploy-dev-build.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Deploy dev build from PR - -on: - workflow_run: - workflows: ["Publish Dist"] # publish-dist.yml - types: - - completed - -jobs: - deploy: - runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' - - steps: - - name: Download Build Artifact - id: download-artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 - continue-on-error: true - with: - name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22 - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - path: temp-dist - - - name: Check if Artifact Exists - if: steps.download-artifact.outcome != 'success' - run: | - echo "No build artifact found for this run. Skipping deployment." - exit 0 - - - name: Prepare Folder Structure - id: prepare-folder-structure - run: | - PR_NUM="${{ github.event.workflow_run.pull_requests[0].number }}" - SHA="${{ github.event.workflow_run.head_sha }}" - - mkdir -p "deploy/pr-$PR_NUM/$SHA" - mkdir -p "deploy/pr-$PR_NUM/latest" - - # Name of file must match name of file uploaded by ci.yml > publish-dist-node-v22 - cp temp-dist/plotly.node22.js "deploy/pr-$PR_NUM/$SHA/plotly.js" - cp temp-dist/plotly.node22.js "deploy/pr-$PR_NUM/latest/plotly.js" - - echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT - echo "SHA=$SHA" >> $GITHUB_OUTPUT - - - name: Generate GitHub App Token - id: generate-token - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 - with: - app-id: ${{ vars.DEV_DEPLOY_APP_ID }} - private-key: ${{ secrets.DEV_DEPLOY_APP_PRIVATE_KEY }} - owner: plotly - repositories: plotly.js-dev-builds - - - name: Deploy to plotly.js-dev-builds repo - uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 - with: - repository-name: plotly/plotly.js-dev-builds - token: ${{ steps.generate-token.outputs.token }} # create-github-app-token action automatically outputs the token - branch: gh-pages - folder: deploy - target-folder: . - clean: false - - - name: Generate Summary - run: | - BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.prepare-folder-structure.outputs.PR_NUM }}" - echo "### PR Build Deployed" >> $GITHUB_STEP_SUMMARY - echo "Builds for PR #${{ steps.prepare-folder-structure.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY - echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY - echo "- [Immutable (this commit)]($BASE/${{ steps.prepare-folder-structure.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index b7619a0caec..e23359b18f1 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -1,17 +1,72 @@ -name: Upload dev build from PR (placeholder, not yet implemented) +name: Upload dev build from PR (IN DEVELOPMENT) on: workflow_run: - workflows: ["CI"] # ci.yml + workflows: ["Publish Dist"] # publish-dist.yml types: - completed - workflow_dispatch: - jobs: - hello: + upload: runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' + steps: - - name: Hello World + - name: Download Build Artifact + id: download-artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + continue-on-error: true + with: + name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22 + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + path: temp-dist + + - name: Check if Artifact Exists + if: steps.download-artifact.outcome != 'success' + run: | + echo "No build artifact found for this run. Skipping upload." + exit 0 + + - name: Prepare Folder Structure + id: prepare-folder-structure + run: | + PR_NUM="${{ github.event.workflow_run.pull_requests[0].number }}" + SHA="${{ github.event.workflow_run.head_sha }}" + + mkdir -p "upload/pr-$PR_NUM/$SHA" + mkdir -p "upload/pr-$PR_NUM/latest" + + # Name of file must match name of file uploaded by ci.yml > publish-dist-node-v22 + cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/$SHA/plotly.js" + cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/latest/plotly.js" + + echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT + echo "SHA=$SHA" >> $GITHUB_OUTPUT + + - name: Generate GitHub App Token + id: generate-token + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 + with: + app-id: ${{ vars.DEV_DEPLOY_APP_ID }} + private-key: ${{ secrets.DEV_DEPLOY_APP_PRIVATE_KEY }} + owner: plotly + repositories: plotly.js-dev-builds + + - name: Upload to plotly.js-dev-builds repo + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 + with: + repository-name: plotly/plotly.js-dev-builds + token: ${{ steps.generate-token.outputs.token }} # create-github-app-token action automatically outputs the token + branch: gh-pages + folder: upload + target-folder: . + clean: false + + - name: Generate Summary run: | - echo "Hello World" + BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.prepare-folder-structure.outputs.PR_NUM }}" + echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY + echo "Builds for PR #${{ steps.prepare-folder-structure.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY + echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY + echo "- [Immutable (this commit)]($BASE/${{ steps.prepare-folder-structure.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY From d7db81670dde485abe18fd92cf0af15df7e147d2 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 10:33:46 -0400 Subject: [PATCH 05/19] run on ALL workflow completions --- .github/workflows/upload-dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index e23359b18f1..96ccdd364f3 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -2,7 +2,7 @@ name: Upload dev build from PR (IN DEVELOPMENT) on: workflow_run: - workflows: ["Publish Dist"] # publish-dist.yml + workflows: ["*"] # publish-dist.yml types: - completed From d9e9d4632b624098198e5e5ec1b1c107b3887e55 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 10:50:06 -0400 Subject: [PATCH 06/19] add workflow_dispatch trigger --- .github/workflows/upload-dev-build.yml | 35 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 96ccdd364f3..7f61afb4dfa 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -1,16 +1,25 @@ -name: Upload dev build from PR (IN DEVELOPMENT) +name: Upload dev build from PR (placeholder, not yet implemented) on: workflow_run: - workflows: ["*"] # publish-dist.yml + workflows: ["Publish Dist"] # publish-dist.yml types: - completed + workflow_dispatch: + inputs: + pr_number: + description: 'PR Number to deploy' + required: true + run_id: + description: 'The Run ID of the CI workflow that has the artifact' + required: true jobs: upload: runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' - + if: | + github.event_name == 'workflow_dispatch' || + (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') steps: - name: Download Build Artifact id: download-artifact @@ -18,7 +27,7 @@ jobs: continue-on-error: true with: name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22 - run-id: ${{ github.event.workflow_run.id }} + run-id: ${{ github.event.workflow_run.id || inputs.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} path: temp-dist @@ -31,13 +40,17 @@ jobs: - name: Prepare Folder Structure id: prepare-folder-structure run: | - PR_NUM="${{ github.event.workflow_run.pull_requests[0].number }}" - SHA="${{ github.event.workflow_run.head_sha }}" + # Get PR number from triggering workflow, or from manual input + PR_NUM="${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}" + # Get SHA from triggering workflow, or from manual input + if [ "${{ github.event_name }}" == "workflow_run" ]; then + SHA="${{ github.event.workflow_run.head_sha }}" + else + echo "Fetching latest SHA for PR #$PR_NUM..." + SHA=$(gh pr view "$PR_NUM" --repo ${{ github.repository }} --json headRefOid --template '{{.headRefOid}}') + fi - mkdir -p "upload/pr-$PR_NUM/$SHA" - mkdir -p "upload/pr-$PR_NUM/latest" - - # Name of file must match name of file uploaded by ci.yml > publish-dist-node-v22 + echo "Using SHA: $SHA" cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/$SHA/plotly.js" cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/latest/plotly.js" From c0efe53df1a23322fb8c40b835bb83202ad992a0 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 10:57:17 -0400 Subject: [PATCH 07/19] use github token --- .github/workflows/upload-dev-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 7f61afb4dfa..7f33a03010e 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -39,6 +39,8 @@ jobs: - name: Prepare Folder Structure id: prepare-folder-structure + env: + GH_TOKEN: ${{ github.token }} run: | # Get PR number from triggering workflow, or from manual input PR_NUM="${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}" From be010b43a6202b424a0a3b38f53e7ee159d2528f Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 11:09:36 -0400 Subject: [PATCH 08/19] artifact upload/download logic --- .github/workflows/publish-dist.yml | 8 -------- .github/workflows/upload-dev-build.yml | 15 +++++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 041eb06853b..f4e93db3db8 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -48,14 +48,6 @@ jobs: - name: Build dist/ run: npm run build - # Upload library uncompressed to allow for testing in REPLs - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - name: Upload uncompressed plotly.js built from PR, using Node 22 - with: - retention-days: 30 - archive: false - path: dist/plotly.js - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 name: Upload Node 18 archive of plotly.js build folder with: diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 7f33a03010e..3ff61eb5c26 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -26,7 +26,7 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 continue-on-error: true with: - name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22 + name: dist-node18 # uploaded by publish-dist.yml > publish-dist-node-v22 run-id: ${{ github.event.workflow_run.id || inputs.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} path: temp-dist @@ -51,11 +51,14 @@ jobs: echo "Fetching latest SHA for PR #$PR_NUM..." SHA=$(gh pr view "$PR_NUM" --repo ${{ github.repository }} --json headRefOid --template '{{.headRefOid}}') fi - - echo "Using SHA: $SHA" - cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/$SHA/plotly.js" - cp temp-dist/plotly.node22.js "upload/pr-$PR_NUM/latest/plotly.js" - + + echo "Using SHA: $SHA" + mkdir -p "upload/pr-$PR_NUM/$SHA" + cp temp-dist/plotly.js "upload/pr-$PR_NUM/$SHA/plotly.js" + cp temp-dist/plotly.min.js "upload/pr-$PR_NUM/$SHA/plotly.min.js" + cp temp-dist/plot-schema.json "upload/pr-$PR_NUM/$SHA/plot-schema.json" + cp -r "upload/pr-$PR_NUM/$SHA/plotly.js" "upload/pr-$PR_NUM/latest" + echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT From 8345fb6bdf82d0a60a4f049879d9620e3b6b3c47 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 11:32:48 -0400 Subject: [PATCH 09/19] check out repo first --- .github/workflows/upload-dev-build.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 3ff61eb5c26..cbfa2aadf35 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -66,20 +66,33 @@ jobs: id: generate-token uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 with: - app-id: ${{ vars.DEV_DEPLOY_APP_ID }} + client-id: ${{ vars.DEV_DEPLOY_APP_ID }} private-key: ${{ secrets.DEV_DEPLOY_APP_PRIVATE_KEY }} owner: plotly repositories: plotly.js-dev-builds + - name: Check out plotly.js-dev-builds repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + repository: plotly/plotly.js-dev-builds + token: ${{ steps.generate-token.outputs.token }} # token from previous step + branch: main + + - name: Change directory + run: | + cd plotly.js-dev-builds + - name: Upload to plotly.js-dev-builds repo uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 with: repository-name: plotly/plotly.js-dev-builds - token: ${{ steps.generate-token.outputs.token }} # create-github-app-token action automatically outputs the token - branch: gh-pages + token: ${{ steps.generate-token.outputs.token }} # token from previous step + branch: main folder: upload target-folder: . clean: false + git-config-name: "plotly.js-pr-upload" + git-config-email: "<>" - name: Generate Summary run: | From 8d39e36f927b15f96c1f1477bce75fef61b9ae7f Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 11:44:31 -0400 Subject: [PATCH 10/19] debugging --- .github/workflows/upload-dev-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index cbfa2aadf35..6e9c62049bb 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -76,11 +76,12 @@ jobs: with: repository: plotly/plotly.js-dev-builds token: ${{ steps.generate-token.outputs.token }} # token from previous step - branch: main + path: plotly.js-dev-builds - name: Change directory run: | cd plotly.js-dev-builds + pwd - name: Upload to plotly.js-dev-builds repo uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 @@ -88,7 +89,7 @@ jobs: repository-name: plotly/plotly.js-dev-builds token: ${{ steps.generate-token.outputs.token }} # token from previous step branch: main - folder: upload + folder: ../upload target-folder: . clean: false git-config-name: "plotly.js-pr-upload" From 1ca42400c8ca77ef0c7d9e4af6daa386b8df0b72 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 11:55:09 -0400 Subject: [PATCH 11/19] more print statements --- .github/workflows/upload-dev-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 6e9c62049bb..e354ba5d0a1 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -59,6 +59,11 @@ jobs: cp temp-dist/plot-schema.json "upload/pr-$PR_NUM/$SHA/plot-schema.json" cp -r "upload/pr-$PR_NUM/$SHA/plotly.js" "upload/pr-$PR_NUM/latest" + UPLOAD_DIR_PATH=$(pwd)/upload/ + + echo "Created directory $UPLOAD_DIR_PATH" with the following full contents:" + echo "$(ls -la $UPLOAD_DIR_PATH)" + echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT From 29458faa0812bd8ec12e393caaf91b85c4d2e87d Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 11:58:36 -0400 Subject: [PATCH 12/19] more print statements --- .github/workflows/upload-dev-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index e354ba5d0a1..9f1d81bd275 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -61,8 +61,8 @@ jobs: UPLOAD_DIR_PATH=$(pwd)/upload/ - echo "Created directory $UPLOAD_DIR_PATH" with the following full contents:" - echo "$(ls -la $UPLOAD_DIR_PATH)" + echo "Created directory ${UPLOAD_DIR_PATH} with the following full contents:" + echo "$(ls -la ${UPLOAD_DIR_PATH})" echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT From a84fb8439caaa9995deaa95aa65ac94e2615f3cb Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 12:15:47 -0400 Subject: [PATCH 13/19] fix path --- .github/workflows/upload-dev-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 9f1d81bd275..b2404657f4a 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -62,7 +62,7 @@ jobs: UPLOAD_DIR_PATH=$(pwd)/upload/ echo "Created directory ${UPLOAD_DIR_PATH} with the following full contents:" - echo "$(ls -la ${UPLOAD_DIR_PATH})" + echo "$(ls -lR ${UPLOAD_DIR_PATH})" echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT @@ -94,7 +94,7 @@ jobs: repository-name: plotly/plotly.js-dev-builds token: ${{ steps.generate-token.outputs.token }} # token from previous step branch: main - folder: ../upload + folder: upload target-folder: . clean: false git-config-name: "plotly.js-pr-upload" From dfbf9304ff460771b0a2b30f18d70ddaf13e4856 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 12:25:23 -0400 Subject: [PATCH 14/19] config --- .github/workflows/upload-dev-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index b2404657f4a..ca04e9b6e2e 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -83,8 +83,9 @@ jobs: token: ${{ steps.generate-token.outputs.token }} # token from previous step path: plotly.js-dev-builds - - name: Change directory + - name: Move files around run: | + mv upload/ plotly.js-dev-builds/upload/ cd plotly.js-dev-builds pwd @@ -95,7 +96,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} # token from previous step branch: main folder: upload - target-folder: . + target-folder: upload clean: false git-config-name: "plotly.js-pr-upload" git-config-email: "<>" From 73a99f239b1915689ed014cd84fc868010eeecd7 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 12:39:49 -0400 Subject: [PATCH 15/19] deploy manually instead of using third-party action --- .github/workflows/upload-dev-build.yml | 51 ++++++++++++++------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index ca04e9b6e2e..f8c048b04b9 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -21,7 +21,7 @@ jobs: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') steps: - - name: Download Build Artifact + - name: Download build artifact id: download-artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 continue-on-error: true @@ -31,14 +31,14 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path: temp-dist - - name: Check if Artifact Exists + - name: Check if artifact exists if: steps.download-artifact.outcome != 'success' run: | echo "No build artifact found for this run. Skipping upload." exit 0 - - name: Prepare Folder Structure - id: prepare-folder-structure + - name: Setup metadata and prepare folders + id: setup-metadata env: GH_TOKEN: ${{ github.token }} run: | @@ -67,7 +67,7 @@ jobs: echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT - - name: Generate GitHub App Token + - name: Generate GitHub App token id: generate-token uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 with: @@ -83,28 +83,33 @@ jobs: token: ${{ steps.generate-token.outputs.token }} # token from previous step path: plotly.js-dev-builds - - name: Move files around + - name: Commit and push files + id: commit-and-push run: | - mv upload/ plotly.js-dev-builds/upload/ + # 1. Move 'upload' directory into repo folder and cd into repo root + mkdir -p plotly.js-dev-builds/upload/ + cp -r upload/* plotly.js-dev-builds/upload/ cd plotly.js-dev-builds - pwd - - name: Upload to plotly.js-dev-builds repo - uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 - with: - repository-name: plotly/plotly.js-dev-builds - token: ${{ steps.generate-token.outputs.token }} # token from previous step - branch: main - folder: upload - target-folder: upload - clean: false - git-config-name: "plotly.js-pr-upload" - git-config-email: "<>" + # 2. Configure git + git config user.name "plotly.js-pr-upload" + git config user.email "<>" + + # 3. add, commit, and push + git add upload/ + + # Only commit if there are changes + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "Deploy build for PR #${{ steps.setup-metadata.outputs.PR_NUM }} - SHA ${{ steps.setup-metadata.outputs.SHA }}" + git push origin main + fi - - name: Generate Summary + - name: Generate summary run: | - BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.prepare-folder-structure.outputs.PR_NUM }}" + BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.setup-metadata.outputs.PR_NUM }}" echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY - echo "Builds for PR #${{ steps.prepare-folder-structure.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY + echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY - echo "- [Immutable (this commit)]($BASE/${{ steps.prepare-folder-structure.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY + echo "- [Immutable (this commit)]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY From 15b5ac83100e83296ae3d872b55d49094d313e2c Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 12:50:58 -0400 Subject: [PATCH 16/19] small fixes --- .github/workflows/upload-dev-build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index f8c048b04b9..fdadfdd3336 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -57,15 +57,16 @@ jobs: cp temp-dist/plotly.js "upload/pr-$PR_NUM/$SHA/plotly.js" cp temp-dist/plotly.min.js "upload/pr-$PR_NUM/$SHA/plotly.min.js" cp temp-dist/plot-schema.json "upload/pr-$PR_NUM/$SHA/plot-schema.json" - cp -r "upload/pr-$PR_NUM/$SHA/plotly.js" "upload/pr-$PR_NUM/latest" + cp -r "upload/pr-$PR_NUM/$SHA/" "upload/pr-$PR_NUM/latest/" UPLOAD_DIR_PATH=$(pwd)/upload/ - echo "Created directory ${UPLOAD_DIR_PATH} with the following full contents:" + echo "Created directory ${UPLOAD_DIR_PATH} with the following contents:" echo "$(ls -lR ${UPLOAD_DIR_PATH})" echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT + echo "SHORT_SHA=${SHA::7}" >> $GITHUB_OUTPUT - name: Generate GitHub App token id: generate-token @@ -88,7 +89,7 @@ jobs: run: | # 1. Move 'upload' directory into repo folder and cd into repo root mkdir -p plotly.js-dev-builds/upload/ - cp -r upload/* plotly.js-dev-builds/upload/ + cp -r upload/ plotly.js-dev-builds/upload/ cd plotly.js-dev-builds # 2. Configure git @@ -102,7 +103,7 @@ jobs: if git diff --staged --quiet; then echo "No changes to commit" else - git commit -m "Deploy build for PR #${{ steps.setup-metadata.outputs.PR_NUM }} - SHA ${{ steps.setup-metadata.outputs.SHA }}" + git commit -m "Deploy build for PR #${{ steps.setup-metadata.outputs.PR_NUM }} (commit ${{ steps.setup-metadata.outputs.SHORT_SHA }})" git push origin main fi From 562fd4fc98d6328ac79607b061cfcb113f610172 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 12:56:37 -0400 Subject: [PATCH 17/19] small fixes --- .github/workflows/upload-dev-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index fdadfdd3336..1c1318b67f2 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -89,7 +89,7 @@ jobs: run: | # 1. Move 'upload' directory into repo folder and cd into repo root mkdir -p plotly.js-dev-builds/upload/ - cp -r upload/ plotly.js-dev-builds/upload/ + cp -r upload/ plotly.js-dev-builds/ cd plotly.js-dev-builds # 2. Configure git @@ -109,7 +109,7 @@ jobs: - name: Generate summary run: | - BASE="https://plotly.github.io/plotly.js-dev-builds/pr-${{ steps.setup-metadata.outputs.PR_NUM }}" + BASE="https://plotly.github.io/plotly.js-dev-builds/upload/pr-${{ steps.setup-metadata.outputs.PR_NUM }}" echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY From bdbcc5ecb8d58e99593f249ba955d6c71cced702 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 13:14:49 -0400 Subject: [PATCH 18/19] more cleanup --- .github/workflows/upload-dev-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 1c1318b67f2..e2083f13eec 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -26,7 +26,7 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 continue-on-error: true with: - name: dist-node18 # uploaded by publish-dist.yml > publish-dist-node-v22 + name: dist-node22 # uploaded by publish-dist.yml > publish-dist-node-v22 run-id: ${{ github.event.workflow_run.id || inputs.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} path: temp-dist @@ -112,5 +112,5 @@ jobs: BASE="https://plotly.github.io/plotly.js-dev-builds/upload/pr-${{ steps.setup-metadata.outputs.PR_NUM }}" echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY - echo "- [Latest for PR]($BASE/latest/plotly.js)" >> $GITHUB_STEP_SUMMARY - echo "- [Immutable (this commit)]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.js)" >> $GITHUB_STEP_SUMMARY + echo "- Latest build for this PR:[$BASE/latest/plotly.min.js]($BASE/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY + echo "- Build for this commit (permalink): [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY From f4c2d81bd22f64164d5827cfd40bf179746a2915 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 5 May 2026 13:48:46 -0400 Subject: [PATCH 19/19] small cleanup --- .github/workflows/upload-dev-build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index e2083f13eec..2a997219d63 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -33,17 +33,18 @@ jobs: - name: Check if artifact exists if: steps.download-artifact.outcome != 'success' + env: + RUN_ID: ${{ github.event.workflow_run.id || inputs.run_id }} run: | - echo "No build artifact found for this run. Skipping upload." + echo "No build artifact found for $RUN_ID. Skipping upload." exit 0 - name: Setup metadata and prepare folders id: setup-metadata env: GH_TOKEN: ${{ github.token }} + PR_NUM: ${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }} run: | - # Get PR number from triggering workflow, or from manual input - PR_NUM="${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}" # Get SHA from triggering workflow, or from manual input if [ "${{ github.event_name }}" == "workflow_run" ]; then SHA="${{ github.event.workflow_run.head_sha }}" @@ -112,5 +113,5 @@ jobs: BASE="https://plotly.github.io/plotly.js-dev-builds/upload/pr-${{ steps.setup-metadata.outputs.PR_NUM }}" echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} are available:" >> $GITHUB_STEP_SUMMARY - echo "- Latest build for this PR:[$BASE/latest/plotly.min.js]($BASE/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY + echo "- Latest build for this PR: [$BASE/latest/plotly.min.js]($BASE/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY echo "- Build for this commit (permalink): [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY