From 4ca51e1d4796f30d4d81186f131811f403314250 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 1/8] add upload-dev-build workflow --- .github/workflows/ci.yml | 117 ---------------------- .github/workflows/publish-dist.yml | 129 +++++++++++++++++++++++++ .github/workflows/upload-dev-build.yml | 110 ++++++++++++++++++++- 3 files changed, 234 insertions(+), 122 deletions(-) create mode 100644 .github/workflows/publish-dist.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79a69597525..5785b12c9bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -575,123 +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: - 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/publish-dist.yml b/.github/workflows/publish-dist.yml new file mode 100644 index 00000000000..f4e93db3db8 --- /dev/null +++ b/.github/workflows/publish-dist.yml @@ -0,0 +1,129 @@ +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 + + - 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 diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index b7619a0caec..2a997219d63 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -2,16 +2,116 @@ name: Upload dev build from PR (placeholder, not yet implemented) on: workflow_run: - workflows: ["CI"] # ci.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: - hello: + upload: runs-on: ubuntu-latest + if: | + github.event_name == 'workflow_dispatch' || + (github.event_name == 'workflow_run' && 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: 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 + + - 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 $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 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 + + 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/" "upload/pr-$PR_NUM/latest/" + + UPLOAD_DIR_PATH=$(pwd)/upload/ + + 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 + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1 + with: + 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 + path: plotly.js-dev-builds + + - name: Commit and push files + id: commit-and-push + 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/ + cd plotly.js-dev-builds + + # 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 }} (commit ${{ steps.setup-metadata.outputs.SHORT_SHA }})" + git push origin main + fi + + - name: Generate summary run: | - echo "Hello World" + 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 "- 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 1720ce7b1d7a0d37e86ea2b6b3f64c57c7c15bd4 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Wed, 6 May 2026 11:16:37 -0400 Subject: [PATCH 2/8] revisions in response to PR comments --- .github/workflows/upload-dev-build.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 2a997219d63..74c218dad3f 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -18,27 +18,22 @@ jobs: upload: runs-on: ubuntu-latest if: | - github.event_name == 'workflow_dispatch' || - (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') + github.event_name == 'workflow_dispatch' || + ( + github.event_name == 'workflow_run' && + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + ) steps: - name: Download build artifact id: download-artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 - continue-on-error: true with: 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 - - 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 $RUN_ID. Skipping upload." - exit 0 - - name: Setup metadata and prepare folders id: setup-metadata env: @@ -114,4 +109,4 @@ jobs: 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 "- 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 + echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY From d215ce50d92627f2205b9bdd023d9b84c2a8586e Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Mon, 11 May 2026 13:32:05 -0400 Subject: [PATCH 3/8] remove upload plotly.js step --- .github/workflows/publish-dist.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index f4e93db3db8..71e0212f844 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -95,22 +95,6 @@ jobs: - 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: From 2f7f4f783de94d8262025c1383b99f547ac57f16 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 12 May 2026 16:27:02 -0400 Subject: [PATCH 4/8] remove unused steps from publish-dist --- .github/workflows/publish-dist.yml | 32 ++++-------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 71e0212f844..9f382c39755 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -34,16 +34,11 @@ jobs: - 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 + # View package.json diff from last release (should show that the version has been changed to the draft version) + git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true - name: Build dist/ run: npm run build @@ -55,13 +50,6 @@ jobs: 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 @@ -81,16 +69,11 @@ jobs: - 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 + # View package.json diff from last release (should show that the version has been changed to the draft version) + git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true - name: Build dist/ run: npm run build @@ -102,12 +85,5 @@ jobs: 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 33b7425ab7df02b86ff5289565231524e30b7bbe Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 12 May 2026 18:29:46 -0400 Subject: [PATCH 5/8] remove NODE_VERSION env var --- .github/workflows/publish-dist.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 9f382c39755..3e4526ca826 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -14,9 +14,6 @@ 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 @@ -28,7 +25,7 @@ jobs: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: ${{ env.NODE_VERSION }} + node-version: '18' cache: 'npm' - name: Set up build environment From a9e2362422b7300339957aa4b2ab971d8b374a86 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 12 May 2026 18:33:29 -0400 Subject: [PATCH 6/8] use short SHA instead of long SHA in directory name --- .github/workflows/upload-dev-build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 74c218dad3f..2e43f343570 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -47,13 +47,15 @@ jobs: echo "Fetching latest SHA for PR #$PR_NUM..." SHA=$(gh pr view "$PR_NUM" --repo ${{ github.repository }} --json headRefOid --template '{{.headRefOid}}') fi + SHORT_SHA=${SHA::7} 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/" "upload/pr-$PR_NUM/latest/" + echo "Short SHA: $SHORT_SHA" + mkdir -p "upload/pr-$PR_NUM/$SHORT_SHA" + cp temp-dist/plotly.js "upload/pr-$PR_NUM/$SHORT_SHA/plotly.js" + cp temp-dist/plotly.min.js "upload/pr-$PR_NUM/$SHORT_SHA/plotly.min.js" + cp temp-dist/plot-schema.json "upload/pr-$PR_NUM/$SHORT_SHA/plot-schema.json" + cp -r "upload/pr-$PR_NUM/$SHORT_SHA/" "upload/pr-$PR_NUM/latest/" UPLOAD_DIR_PATH=$(pwd)/upload/ @@ -62,7 +64,7 @@ jobs: echo "PR_NUM=$PR_NUM" >> $GITHUB_OUTPUT echo "SHA=$SHA" >> $GITHUB_OUTPUT - echo "SHORT_SHA=${SHA::7}" >> $GITHUB_OUTPUT + echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT - name: Generate GitHub App token id: generate-token From a9a66faaee51901ea81cb8925bf0f9b336810b67 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 12 May 2026 18:47:12 -0400 Subject: [PATCH 7/8] modify summary --- .github/workflows/upload-dev-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 2e43f343570..89413ad783d 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -109,6 +109,7 @@ jobs: run: | 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 "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} can be accessed at:" >> $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: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY + echo "The above links should start working a minute or two after this job completes." >> $GITHUB_STEP_SUMMARY From e09ca4179c0a80560c28ac630cd3ba14b2122184 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Wed, 13 May 2026 14:46:03 -0400 Subject: [PATCH 8/8] retain only plotly.min.js artifact for per-commit uploads --- .github/workflows/upload-dev-build.yml | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/upload-dev-build.yml b/.github/workflows/upload-dev-build.yml index 89413ad783d..a24bc1cde49 100644 --- a/.github/workflows/upload-dev-build.yml +++ b/.github/workflows/upload-dev-build.yml @@ -48,23 +48,26 @@ jobs: SHA=$(gh pr view "$PR_NUM" --repo ${{ github.repository }} --json headRefOid --template '{{.headRefOid}}') fi SHORT_SHA=${SHA::7} + UPLOAD_DIR_NAME="upload" - echo "Using SHA: $SHA" - echo "Short SHA: $SHORT_SHA" - mkdir -p "upload/pr-$PR_NUM/$SHORT_SHA" - cp temp-dist/plotly.js "upload/pr-$PR_NUM/$SHORT_SHA/plotly.js" - cp temp-dist/plotly.min.js "upload/pr-$PR_NUM/$SHORT_SHA/plotly.min.js" - cp temp-dist/plot-schema.json "upload/pr-$PR_NUM/$SHORT_SHA/plot-schema.json" - cp -r "upload/pr-$PR_NUM/$SHORT_SHA/" "upload/pr-$PR_NUM/latest/" + echo "Using SHA: ${SHA}" + echo "Short SHA: ${SHORT_SHA}" + mkdir -p "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/latest" + mkdir -p "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/${SHORT_SHA}" + # Copy all 3 artifacts (plotly.js, plotly.min.js, plot-schema.json) to /latest/ + cp temp-dist/plotly.js "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/latest/plotly.js" + cp temp-dist/plotly.min.js "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/latest/plotly.min.js" + cp temp-dist/plot-schema.json "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/latest/plot-schema.json" + # Copy only plotly.min.js to /$SHORT_SHA/ + cp temp-dist/plotly.min.js "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/${SHORT_SHA}/plotly.min.js" - UPLOAD_DIR_PATH=$(pwd)/upload/ + UPLOAD_DIR_FULL_PATH=$(pwd)/${UPLOAD_DIR_NAME}/ + echo "Created directory ${UPLOAD_DIR_FULL_PATH} with the following contents:" + echo "$(ls -lR ${UPLOAD_DIR_FULL_PATH})" - 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=$SHORT_SHA" >> $GITHUB_OUTPUT + echo "PR_NUM=${PR_NUM}" >> $GITHUB_OUTPUT + echo "SHA=${SHA}" >> $GITHUB_OUTPUT + echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_OUTPUT - name: Generate GitHub App token id: generate-token