-
-
Notifications
You must be signed in to change notification settings - Fork 2k
129 lines (101 loc) · 4.76 KB
/
publish-dist.yml
File metadata and controls
129 lines (101 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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