Skip to content

Commit bf3cf22

Browse files
committed
separate publish-dist into separate workflow
1 parent 55fafae commit bf3cf22

3 files changed

Lines changed: 139 additions & 120 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -575,124 +575,6 @@ jobs:
575575
# ============================================================
576576
# Standalone jobs (no dependencies on install-and-cibuild)
577577
# ============================================================
578-
publish-dist:
579-
runs-on: ubuntu-latest
580-
steps:
581-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
582-
with:
583-
fetch-depth: 0
584-
fetch-tags: true
585-
586-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
587-
with:
588-
node-version: ${{ env.NODE_VERSION }}
589-
cache: 'npm'
590-
591-
- name: Set up build environment
592-
run: .github/scripts/env_build.sh
593-
594-
- name: Preview CHANGELOG for next release (only on master)
595-
if: github.ref == 'refs/heads/master'
596-
run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
597-
598-
- name: Set draft version in package.json
599-
run: |
600-
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)
601-
602-
- name: View package.json diff between previous and next releases
603-
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
604-
605-
- name: Build dist/
606-
run: npm run build
607-
608-
# Upload library uncompressed to allow for testing in REPLs
609-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
610-
name: Upload uncompressed plotly.js built from PR, using Node 22
611-
with:
612-
retention-days: 30
613-
archive: false
614-
path: dist/plotly.js
615-
616-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
617-
name: Upload Node 18 archive of plotly.js build folder
618-
with:
619-
name: dist-node18
620-
retention-days: 7
621-
path: dist/
622-
623-
- name: View dist/README.md diff between previous and next releases
624-
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true
625-
626-
- name: Preview plot-schema diff (only on master)
627-
if: github.ref == 'refs/heads/master'
628-
run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
629-
630-
- name: Test plot-schema.json diff
631-
run: diff --unified --color dist/plot-schema.json test/plot-schema.json
632-
633-
publish-dist-node-v22:
634-
runs-on: ubuntu-latest
635-
steps:
636-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
637-
with:
638-
fetch-depth: 0
639-
fetch-tags: true
640-
641-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
642-
with:
643-
node-version: '22.14.0'
644-
cache: 'npm'
645-
646-
- name: Set up build environment
647-
run: .github/scripts/env_build.sh
648-
649-
- name: Preview CHANGELOG for next release (only on master)
650-
if: github.ref == 'refs/heads/master'
651-
run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
652-
653-
- name: Set draft version in package.json
654-
run: |
655-
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)
656-
657-
- name: View package.json diff between previous and next releases
658-
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
659-
660-
- name: Build dist/
661-
run: npm run build
662-
663-
# This is necessary to avoid a naming collision with the upload from the Node 18 build
664-
- name: Copy library for upload
665-
run: cp dist/plotly.js dist/plotly.node22.js
666-
667-
# Upload library uncompressed to allow for testing in REPLs
668-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
669-
name: Upload uncompressed plotly.js built from PR, using Node 22
670-
with:
671-
name: plotly.node22.js
672-
retention-days: 30
673-
archive: false
674-
path: dist/plotly.node22.js
675-
676-
- name: Remove copy of library
677-
run: rm dist/plotly.node22.js
678-
679-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
680-
name: Upload Node 22 archive of plotly.js build folder
681-
with:
682-
name: dist-node22
683-
retention-days: 7
684-
path: dist/
685-
686-
- name: View dist/README.md diff between previous and next releases
687-
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true
688-
689-
- name: Preview plot-schema diff (only on master)
690-
if: github.ref == 'refs/heads/master'
691-
run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
692-
693-
- name: Test plot-schema.json diff
694-
run: diff --unified --color dist/plot-schema.json test/plot-schema.json
695-
696578
test-stackgl-bundle:
697579
needs: detect-changes
698580
if: >-

.github/workflows/deploy-dev-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy dev build from PR
22

33
on:
44
workflow_run:
5-
workflows: ["CI"] # ci.yml
5+
workflows: ["Publish Dist"] # publish-dist.yml
66
types:
77
- completed
88

@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1818
continue-on-error: true
1919
with:
20-
name: plotly.node22.js # uploaded by ci.yml > publish-dist-node-v22
20+
name: plotly.node22.js # uploaded by publish-dist.yml > publish-dist-node-v22
2121
run-id: ${{ github.event.workflow_run.id }}
2222
github-token: ${{ secrets.GITHUB_TOKEN }}
2323
path: temp-dist

.github/workflows/publish-dist.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Publish Dist
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: publish-dist-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
NODE_VERSION: '18'
19+
20+
jobs:
21+
publish-dist:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
with:
26+
fetch-depth: 0
27+
fetch-tags: true
28+
29+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
30+
with:
31+
node-version: ${{ env.NODE_VERSION }}
32+
cache: 'npm'
33+
34+
- name: Set up build environment
35+
run: .github/scripts/env_build.sh
36+
37+
- name: Preview CHANGELOG for next release (only on master)
38+
if: github.ref == 'refs/heads/master'
39+
run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
40+
41+
- name: Set draft version in package.json
42+
run: |
43+
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)
44+
45+
- name: View package.json diff between previous and next releases
46+
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
47+
48+
- name: Build dist/
49+
run: npm run build
50+
51+
# Upload library uncompressed to allow for testing in REPLs
52+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
53+
name: Upload uncompressed plotly.js built from PR, using Node 22
54+
with:
55+
retention-days: 30
56+
archive: false
57+
path: dist/plotly.js
58+
59+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
60+
name: Upload Node 18 archive of plotly.js build folder
61+
with:
62+
name: dist-node18
63+
retention-days: 7
64+
path: dist/
65+
66+
- name: View dist/README.md diff between previous and next releases
67+
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true
68+
69+
- name: Preview plot-schema diff (only on master)
70+
if: github.ref == 'refs/heads/master'
71+
run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
72+
73+
- name: Test plot-schema.json diff
74+
run: diff --unified --color dist/plot-schema.json test/plot-schema.json
75+
76+
publish-dist-node-v22:
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
80+
with:
81+
fetch-depth: 0
82+
fetch-tags: true
83+
84+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
85+
with:
86+
node-version: '22.14.0'
87+
cache: 'npm'
88+
89+
- name: Set up build environment
90+
run: .github/scripts/env_build.sh
91+
92+
- name: Preview CHANGELOG for next release (only on master)
93+
if: github.ref == 'refs/heads/master'
94+
run: npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
95+
96+
- name: Set draft version in package.json
97+
run: |
98+
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)
99+
100+
- name: View package.json diff between previous and next releases
101+
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
102+
103+
- name: Build dist/
104+
run: npm run build
105+
106+
# This is necessary to avoid a naming collision with the upload from the Node 18 build
107+
- name: Copy library for upload
108+
run: cp dist/plotly.js dist/plotly.node22.js
109+
110+
# Upload library uncompressed to allow for testing in REPLs
111+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
112+
name: Upload uncompressed plotly.js built from PR, using Node 22
113+
with:
114+
name: plotly.node22.js
115+
retention-days: 30
116+
archive: false
117+
path: dist/plotly.node22.js
118+
119+
- name: Remove copy of library
120+
run: rm dist/plotly.node22.js
121+
122+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
123+
name: Upload Node 22 archive of plotly.js build folder
124+
with:
125+
name: dist-node22
126+
retention-days: 7
127+
path: dist/
128+
129+
- name: View dist/README.md diff between previous and next releases
130+
run: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true
131+
132+
- name: Preview plot-schema diff (only on master)
133+
if: github.ref == 'refs/heads/master'
134+
run: git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
135+
136+
- name: Test plot-schema.json diff
137+
run: diff --unified --color dist/plot-schema.json test/plot-schema.json

0 commit comments

Comments
 (0)