Skip to content

Commit f05fa02

Browse files
committed
build: process random sample of 1k packages in keep alive
1 parent 1b5ac87 commit f05fa02

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/standalone_keepalive.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ name: standalone_keepalive
2121

2222
# Workflow triggers:
2323
on:
24-
# Run the workflow on the first day of each month:
24+
# Run the workflow on the first day of each week:
2525
schedule:
26-
- cron: '0 0 1 * *'
26+
- cron: '0 0 * * 1'
2727

2828
# Allow the workflow to be manually run:
2929
workflow_dispatch:

lib/node_modules/@stdlib/_tools/scripts/publish_packages.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var memoize = require( '@stdlib/utils/memoize' );
4545
var repeat = require( '@stdlib/string/repeat' );
4646
var trim = require( '@stdlib/string/trim' );
4747
var copy = require( '@stdlib/utils/copy' );
48+
var sample = require( '@stdlib/random/sample' );
4849
var rootDir = require( '@stdlib/_tools/utils/root-dir' );
4950
var rescape = require( '@stdlib/utils/escape-regexp-string' );
5051
var replace = require( '@stdlib/string/replace' );
@@ -73,6 +74,7 @@ var debug = logger( 'scripts:publish-packages' );
7374
var START_PKG_INDEX = parseInt( flags[ 'start-index' ], 10 ) || 0;
7475
var END_PKG_INDEX = ( flags[ 'end-index' ] === void 0 ) ? 9999 : parseInt( flags[ 'end-index' ], 10 );
7576
var MAX_TREE_DEPTH = 99;
77+
var KEEP_ALIVE_SAMPLE_SIZE = 1000;
7678

7779
var topics = setTopics.factory( {
7880
'token': ENV.GITHUB_TOKEN
@@ -1432,6 +1434,12 @@ function main() {
14321434
debug( 'Successfully wrote list to file.' );
14331435

14341436
pkgs = pkgs.slice( START_PKG_INDEX, END_PKG_INDEX + 1 );
1437+
if ( flags[ 'keep-alive' ] ) {
1438+
pkgs = sample( pkgs, {
1439+
'size': KEEP_ALIVE_SAMPLE_SIZE,
1440+
'replace': false
1441+
});
1442+
}
14351443
for ( i = 0; i < pkgs.length; i++ ) {
14361444
pkgs[ i ] = replace( pkgs[ i ], '@stdlib/', '' );
14371445
}

0 commit comments

Comments
 (0)