Skip to content

Commit e765688

Browse files
areClient Engineering Bot
andauthored
fix: create gzipped publish artifacts (#267)
* fix: create gzipped publish artifacts * fix: compat with node 12 * fix: add normal build artifacts to output * fix: update workflow paths * PubNub SDK v6.0.0 release. * fix: revert duplicated changelog Co-authored-by: Client Engineering Bot <60980775+Client Engineering [email protected]>
1 parent 9b11d07 commit e765688

File tree

7 files changed

+74
-7
lines changed

7 files changed

+74
-7
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Automated product release
22

33
on:
44
pull_request:
5-
branches: [ master ]
6-
types: [ closed ]
7-
5+
branches: [master]
6+
types: [closed]
87

98
jobs:
109
check-release:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dist/web/stats.json
1414
dist/titanium/stats.json
1515
dist/contract
1616
dist/cucumber
17+
upload
1718

1819
# GitHub Actions #
1920
##################

.pubnub.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
changelog:
3-
- date: 2022-04-14
3+
- date: 2022-04-21
44
version: v6.0.0
55
changes:
66
- type: feature

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## v6.0.0
2-
April 14 2022
2+
April 21 2022
33

44
#### Added
55
- Added a TypeScript build chain and moved from webpack to rollup.

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"prettier": "^2.5.1",
9090
"rimraf": "^3.0.2",
9191
"rollup": "^2.68.0",
92+
"rollup-plugin-gzip": "^3.0.1",
9293
"rollup-plugin-terser": "^7.0.2",
9394
"sinon": "^7.5.0",
9495
"sinon-chai": "^3.3.0",

rollup.config.js

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import { join, basename, dirname } from 'path';
2+
13
import typescript from '@rollup/plugin-typescript';
24
import commonjs from '@rollup/plugin-commonjs';
35
import resolve from '@rollup/plugin-node-resolve';
46
import json from '@rollup/plugin-json';
57

68
import { terser } from 'rollup-plugin-terser';
9+
import gzipPlugin from 'rollup-plugin-gzip';
710

8-
import { browser } from './package.json';
11+
import { browser, version } from './package.json';
912
import tsConfig from './tsconfig.rollup.json';
1013

1114
export default [
@@ -21,7 +24,50 @@ export default [
2124
{
2225
input: 'src/web/index.js',
2326
output: {
24-
file: 'dist/web/pubnub.js',
27+
file: join(dirname(browser), basename(browser, '.min.js') + '.js'),
28+
format: 'umd',
29+
name: 'PubNub',
30+
},
31+
plugins: [json(), resolve({ browser: true }), commonjs(), typescript(tsConfig)],
32+
},
33+
{
34+
input: 'src/web/index.js',
35+
output: {
36+
file: `upload/gzip/pubnub.${version}.min.js`,
37+
format: 'umd',
38+
name: 'PubNub',
39+
},
40+
plugins: [
41+
json(),
42+
resolve({ browser: true }),
43+
commonjs(),
44+
typescript(tsConfig),
45+
terser(),
46+
gzipPlugin({ fileName: '' }),
47+
],
48+
},
49+
{
50+
input: 'src/web/index.js',
51+
output: {
52+
file: `upload/gzip/pubnub.${version}.js`,
53+
format: 'umd',
54+
name: 'PubNub',
55+
},
56+
plugins: [json(), resolve({ browser: true }), commonjs(), typescript(tsConfig), gzipPlugin({ fileName: '' })],
57+
},
58+
{
59+
input: 'src/web/index.js',
60+
output: {
61+
file: `upload/normal/pubnub.${version}.min.js`,
62+
format: 'umd',
63+
name: 'PubNub',
64+
},
65+
plugins: [json(), resolve({ browser: true }), commonjs(), typescript(tsConfig), terser()],
66+
},
67+
{
68+
input: 'src/web/index.js',
69+
output: {
70+
file: `upload/normal/pubnub.${version}.js`,
2571
format: 'umd',
2672
name: 'PubNub',
2773
},

0 commit comments

Comments
 (0)