File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name: Purge jsDelivr Cache
2+ description: Purges jsDelivr cache for a list of files
3+ inputs:
4+ package:
5+ description: Package name and version (e.g. cloudinary-video-player@1.0.0 or cloudinary-video-player@edge)
6+ required: true
7+ delay-ms:
8+ description: Delay between purge requests in milliseconds
9+ required: false
10+ default: "300"
11+
12+ runs:
13+ using: "composite"
14+ steps:
15+ - name: Purge jsDelivr cache
16+ shell: bash
17+ run: |
18+ echo "Purging jsDelivr cache for ${{ inputs.package }}"
19+ DELAY=${{ inputs.delay-ms }}
20+
21+ find dist -type f | while read file; do
22+ PURGE_URL="https://purge.jsdelivr.net/npm/${{ inputs.package }}/$file"
23+ echo "Purging: $PURGE_URL"
24+ curl --retry 3 --retry-delay 2 --fail -s "$PURGE_URL"
25+ sleep $(echo "$DELAY / 1000" | bc -l)
26+ done
Original file line number Diff line number Diff line change 9393 SLACK_MESSAGE : ${{ steps.set-messages.outputs.SLACK_MESSAGE }}
9494 SLACK_FOOTER : ${{ steps.set-messages.outputs.SLACK_FOOTER }}
9595
96- - uses : gacts/purge-jsdelivr-cache@v1
96+ - name : Purge jsDelivr Cache
97+ uses : ./.github/actions/purge-jsdelivr
9798 with :
98- url : |
99- https://cdn.jsdelivr.net/npm/cloudinary-video-player@edge
99+ package : cloudinary-video-player@edge
Original file line number Diff line number Diff line change 6464 SLACK_MESSAGE : ${{ steps.set-messages.outputs.SLACK_MESSAGE }}
6565 SLACK_FOOTER : ${{ steps.set-messages.outputs.SLACK_FOOTER }}
6666
67- - uses : gacts/purge-jsdelivr-cache@v1
67+ - name : Purge jsDelivr Cache
6868 if : steps.release.outputs.release_created
69+ uses : ./.github/actions/purge-jsdelivr
6970 with :
70- url : |
71- https://cdn.jsdelivr.net/npm/cloudinary-video-player
72- https://cdn.jsdelivr.net/npm/cloudinary-video-player@edge
71+ package : cloudinary-video-player
Original file line number Diff line number Diff line change @@ -2,16 +2,38 @@ const { merge } = require('webpack-merge');
22const webpackCommon = require ( './common.config' ) ;
33const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
44const CssMinimizerPlugin = require ( 'css-minimizer-webpack-plugin' ) ;
5+ const BannerPlugin = require ( 'webpack/lib/BannerPlugin' ) ;
56const { isMin } = require ( './build-utils' ) ;
67
8+ const VERSION = JSON . stringify ( process . env . npm_package_version ) ;
9+
710module . exports = merge ( webpackCommon , {
811 mode : 'production' ,
912
1013 optimization : isMin ? {
1114 minimize : true ,
1215 minimizer : [
1316 new CssMinimizerPlugin ( ) ,
14- new TerserPlugin ( )
17+ new TerserPlugin ( {
18+ terserOptions : {
19+ format : {
20+ comments : / ^ ! /
21+ }
22+ } ,
23+ extractComments : false
24+ } )
1525 ]
16- } : undefined
26+ } : undefined ,
27+
28+ plugins : [
29+ new BannerPlugin ( {
30+ banner : `/*!
31+ * Cloudinary Video Player v${ VERSION . replace ( / " / g, '' ) }
32+ * Built on ${ new Date ( ) . toISOString ( ) }
33+ * https://github.com/cloudinary/cloudinary-video-player
34+ */` ,
35+ entryOnly : false ,
36+ raw : true
37+ } )
38+ ]
1739} ) ;
Original file line number Diff line number Diff line change @@ -3,13 +3,25 @@ const webpackCommon = require('./common.config');
33const path = require ( 'path' ) ;
44const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
55const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
6+ const BannerPlugin = require ( 'webpack/lib/BannerPlugin' ) ;
67
78const env = require ( '../env' ) ;
89
10+ const VERSION = JSON . stringify ( process . env . npm_package_version ) ;
11+
912module . exports = merge ( webpackCommon , {
1013 mode : 'development' ,
1114
1215 plugins : [
16+ new BannerPlugin ( {
17+ banner : `/*!
18+ * Cloudinary Video Player v${ VERSION . replace ( / " / g, '' ) }
19+ * Built on ${ new Date ( ) . toISOString ( ) }
20+ * https://github.com/cloudinary/cloudinary-video-player
21+ */` ,
22+ entryOnly : false ,
23+ raw : true
24+ } ) ,
1325 new HtmlWebpackPlugin ( {
1426 inject : false ,
1527 template : path . resolve ( __dirname , '../docs/index.html' )
You can’t perform that action at this time.
0 commit comments