Skip to content

Commit 658b4c4

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents 8b03d66 + a968b58 commit 658b4c4

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2022 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: standalone_keepalive
21+
22+
# Workflow triggers:
23+
on:
24+
# Rune the workflow on the first day of each month:
25+
schedule:
26+
cron: '0 0 1 * *'
27+
28+
# Allow the workflow to be manually run:
29+
workflow_dispatch:
30+
31+
# Workflow concurrency group:
32+
concurrency:
33+
34+
# Specify a group name:
35+
group: ${{ github.workflow }}
36+
37+
# Specify whether to cancel any currently running workflow in the same concurrency group:
38+
cancel-in-progress: false
39+
40+
# Workflow jobs:
41+
jobs:
42+
43+
# Define a job for scheduled updates to standalone packages...
44+
keepalive:
45+
46+
# Define a display name:
47+
name: 'Keep Alive'
48+
49+
# Define the type of virtual host machine:
50+
runs-on: ubuntu-latest
51+
52+
# Define the sequence of job steps...
53+
steps:
54+
55+
# Checkout the repository:
56+
- name: 'Checkout repository'
57+
uses: actions/checkout@v2
58+
with:
59+
# Specify whether to remove untracked files before checking out the repository:
60+
clean: false
61+
62+
# Limit clone depth to the most recent commit:
63+
fetch-depth: 1
64+
65+
# Specify whether to download Git-LFS files:
66+
lfs: false
67+
timeout-minutes: 10
68+
69+
# Install Node.js:
70+
- name: 'Install Node.js'
71+
uses: actions/setup-node@v2
72+
with:
73+
node-version: '16' # 'lts/*'
74+
timeout-minutes: 5
75+
76+
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
77+
- name: 'Install dependencies'
78+
run: |
79+
make install-node-modules || make install-node-modules || make install-node-modules
80+
timeout-minutes: 15
81+
82+
# Update standalone packages:
83+
- name: 'Update standalone packages'
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
86+
run: |
87+
node lib/node_modules/@stdlib/_tools/scripts/publish_packages.js --keep-alive

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@ function publish( pkg, clbk ) {
699699
}
700700
fs.copyFileSync( join( __dirname, 'templates', 'workflow_cancel.yml.txt' ), join( dist, '.github', 'workflows', 'cancel.yml' ) );
701701

702+
// Write the current date to the `.keepalive` file...
703+
if ( flags[ 'keep-alive' ] ) {
704+
fs.writeFileSync( join( dist, '.github', '.keepalive' ), new Date().toISOString() );
705+
}
706+
702707
debug( 'Saving `package.json` file...' );
703708
writeFileSync( pkgJsonPath, JSON.stringify( pkgJSON, null, ' ' ).concat( '\n' ) );
704709

0 commit comments

Comments
 (0)