Skip to content

Commit 3632548

Browse files
committed
Auto-generated commit
1 parent c218806 commit 3632548

File tree

6 files changed

+149
-75
lines changed

6 files changed

+149
-75
lines changed

.github/workflows/productionize.yml

Lines changed: 119 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ name: productionize
2121

2222
# Workflow triggers:
2323
on:
24-
# Run workflow when a new commit is pushed to the repository:
24+
# Run workflow when a new commit is pushed to the main branch:
2525
push:
26+
branches:
27+
- main
2628

2729
# Allow the workflow to be manually run:
2830
workflow_dispatch:
2931

32+
# Concurrency group to prevent multiple concurrent executions:
33+
concurrency:
34+
group: productionize
35+
cancel-in-progress: true
36+
3037
# Workflow jobs:
3138
jobs:
3239

@@ -168,8 +175,8 @@ jobs:
168175
# Define the type of virtual host machine on which to run the job:
169176
runs-on: ubuntu-latest
170177

171-
# Indicate that this job depends on the prior job finishing:
172-
needs: productionize
178+
# Indicate that this job depends on the test job finishing:
179+
needs: test
173180

174181
# Define the sequence of job steps...
175182
steps:
@@ -309,21 +316,12 @@ jobs:
309316
git add -A
310317
git commit -m "Auto-generated commit"
311318
312-
# Push changes to `deno` branch or create new branch tag:
313-
- name: 'Push changes to `deno` branch or create new branch tag'
319+
# Push changes to `deno` branch:
320+
- name: 'Push changes to `deno` branch'
314321
run: |
315322
SLUG=${{ github.repository }}
316-
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
317-
if [ -z "$VERSION" ]; then
318-
echo "Workflow job was not triggered by a new tag...."
319-
echo "Pushing changes to $SLUG..."
320-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
321-
else
322-
echo "Workflow job was triggered by a new tag: $VERSION"
323-
echo "Creating new bundle branch tag of the form $VERSION-deno"
324-
git tag -a $VERSION-deno -m "$VERSION-deno"
325-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-deno
326-
fi
323+
echo "Pushing changes to $SLUG..."
324+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
327325
328326
# Send status to Slack channel if job fails:
329327
- name: 'Send status to Slack channel in case of failure'
@@ -343,8 +341,8 @@ jobs:
343341
# Define the type of virtual host machine on which to run the job:
344342
runs-on: ubuntu-latest
345343

346-
# Indicate that this job depends on the prior job finishing:
347-
needs: productionize
344+
# Indicate that this job depends on the test job finishing:
345+
needs: test
348346

349347
# Define the sequence of job steps...
350348
steps:
@@ -482,21 +480,12 @@ jobs:
482480
git add -A
483481
git commit -m "Auto-generated commit"
484482
485-
# Push changes to `umd` branch or create new branch tag:
486-
- name: 'Push changes to `umd` branch or create new branch tag'
483+
# Push changes to `umd` branch:
484+
- name: 'Push changes to `umd` branch'
487485
run: |
488486
SLUG=${{ github.repository }}
489-
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
490-
if [ -z "$VERSION" ]; then
491-
echo "Workflow job was not triggered by a new tag...."
492-
echo "Pushing changes to $SLUG..."
493-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
494-
else
495-
echo "Workflow job was triggered by a new tag: $VERSION"
496-
echo "Creating new bundle branch tag of the form $VERSION-umd"
497-
git tag -a $VERSION-umd -m "$VERSION-umd"
498-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-umd
499-
fi
487+
echo "Pushing changes to $SLUG..."
488+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
500489
501490
# Send status to Slack channel if job fails:
502491
- name: 'Send status to Slack channel in case of failure'
@@ -516,8 +505,8 @@ jobs:
516505
# Define the type of virtual host machine on which to run the job:
517506
runs-on: ubuntu-latest
518507

519-
# Indicate that this job depends on the prior job finishing:
520-
needs: productionize
508+
# Indicate that this job depends on the test job finishing:
509+
needs: test
521510

522511
# Define the sequence of job steps...
523512
steps:
@@ -661,21 +650,12 @@ jobs:
661650
git add -A
662651
git commit -m "Auto-generated commit"
663652
664-
# Push changes to `esm` branch or create new branch tag:
665-
- name: 'Push changes to `esm` branch or create new branch tag'
653+
# Push changes to `esm` branch:
654+
- name: 'Push changes to `esm` branch'
666655
run: |
667656
SLUG=${{ github.repository }}
668-
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
669-
if [ -z "$VERSION" ]; then
670-
echo "Workflow job was not triggered by a new tag...."
671-
echo "Pushing changes to $SLUG..."
672-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm
673-
else
674-
echo "Workflow job was triggered by a new tag: $VERSION"
675-
echo "Creating new bundle branch tag of the form $VERSION-esm"
676-
git tag -a $VERSION-esm -m "$VERSION-esm"
677-
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-esm
678-
fi
657+
echo "Pushing changes to $SLUG..."
658+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm
679659
680660
# Send status to Slack channel if job fails:
681661
- name: 'Send status to Slack channel in case of failure'
@@ -685,3 +665,96 @@ jobs:
685665
steps: ${{ toJson(steps) }}
686666
channel: '#npm-ci'
687667
if: failure()
668+
669+
# Define job that succeeds if all bundles were successfully built:
670+
create-tag-bundles:
671+
672+
# Define display name:
673+
name: 'Create tag bundles'
674+
675+
# Define the type of virtual host machine on which to run the job:
676+
runs-on: ubuntu-latest
677+
678+
# Indicate that this job depends on the bundle jobs finishing:
679+
needs: [ deno, umd, esm ]
680+
681+
# Define the steps to be executed:
682+
steps:
683+
684+
# Checkout the repository:
685+
- name: 'Checkout repository'
686+
uses: actions/checkout@v3
687+
with:
688+
fetch-depth: 2
689+
690+
# Check if workflow run was triggered by a patch, minor, or major version bump:
691+
- name: 'Check if workflow run was triggered by a patch, minor, or major version bump'
692+
id: check-if-bump
693+
continue-on-error: true
694+
run: |
695+
VERSION_CHANGE_PKG_JSON=$(git diff HEAD~1 HEAD package.json | grep '"version":')
696+
if [ -z "$VERSION_CHANGE_PKG_JSON" ]; then
697+
echo "This workflow was not triggered by a version bump."
698+
echo "::set-output name=bump::false"
699+
else
700+
echo "This workflow was triggered by a version bump."
701+
echo "::set-output name=bump::true"
702+
fi
703+
704+
# Configure git:
705+
- name: 'Configure git'
706+
if: steps.check-if-bump.outputs.bump
707+
run: |
708+
git config --local user.email "[email protected]"
709+
git config --local user.name "stdlib-bot"
710+
git fetch --all
711+
712+
# Create bundle tags:
713+
- name: 'Create bundle tags'
714+
if: steps.check-if-bump.outputs.bump
715+
run: |
716+
SLUG=${{ github.repository }}
717+
ESCAPED=$(echo $SLUG | sed -E 's/\//\\\//g')
718+
VERSION="v$(jq --raw-output '.version' package.json)"
719+
720+
git checkout -b deno origin/deno
721+
sed -i -E "s/$ESCAPED@deno/$ESCAPED@$VERSION-deno/g" README.md
722+
git add README.md
723+
git commit -m "Update README.md for Deno bundle $VERSION"
724+
git tag -a $VERSION-deno -m "$VERSION-deno"
725+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-deno
726+
sed -i -E "s/$ESCAPED@$VERSION-deno/$ESCAPED@deno/g" README.md
727+
728+
perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the \[tagged bundles\]\(https:\/\/github.com\/$ESCAPED\/tags\). For example,\n\n\`\`\`javascript\nimport \1 from 'https:\/\/cdn\.jsdelivr\.net\/gh\/$ESCAPED\@$VERSION-deno\/mod\.js';\n\`\`\`/" README.md
729+
730+
git add README.md
731+
git commit -m "Auto-generated commit"
732+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
733+
734+
git checkout -b umd origin/umd
735+
sed -i -E "s/$ESCAPED@umd/$ESCAPED@$VERSION-umd/g" README.md
736+
git add README.md
737+
git commit -m "Update README.md for UMD bundle $VERSION"
738+
git tag -a $VERSION-umd -m "$VERSION-umd"
739+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-umd
740+
sed -i -E "s/$ESCAPED@$VERSION-umd/$ESCAPED@umd/g" README.md
741+
742+
perl -0777 -i -pe "s/\`\`\`javascript\n([a-zA-Z0-9_]+)\s+=\s*require\(\s*'([^']+)'\s*\)\n\`\`\`/\`\`\`javascript\n\1 = require\( '\2' \)\n\`\`\`\n\The previous example will load the latest bundled code from the umd branch. Alternatively, you may load a specific version by loading the file from one of the \[tagged bundles\]\(https:\/\/github.com\/$ESCAPED\/tags\). For example,\n\n\`\`\`javascript\n\1 = require\( 'https:\/\/cdn\.jsdelivr\.net\/gh\/$ESCAPED\@$VERSION-umd\/browser\.js' \)\n\`\`\`/" README.md
743+
744+
git add README.md
745+
git commit -m "Auto-generated commit"
746+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
747+
748+
git checkout -b esm origin/esm
749+
sed -i -E "s/$ESCAPED@esm/$ESCAPED@$VERSION-esm/g" README.md
750+
git add README.md
751+
git commit -m "Update README.md for ESM bundle $VERSION"
752+
git tag -a $VERSION-esm -m "$VERSION-esm"
753+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-esm
754+
sed -i -E "s/$ESCAPED@$VERSION-esm/$ESCAPED@esm/g" README.md
755+
756+
perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\The previous example will load the latest bundled code from the esm branch. Alternatively, you may load a specific version by loading the file from one of the \[tagged bundles\]\(https:\/\/github.com\/$ESCAPED\/tags\). For example,\n\n\`\`\`javascript\nimport \1 from 'https:\/\/cdn\.jsdelivr\.net\/gh\/$ESCAPED\@$VERSION-esm\/index\.mjs';\n\`\`\`/" README.md
757+
758+
git add README.md
759+
git commit -m "Auto-generated commit"
760+
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
# Allow the workflow to be manually run:
3030
workflow_dispatch:
3131

32-
# Run workflow on each push:
32+
# Run workflow on each push to the main branch:
3333
push:
3434

3535
# Workflow jobs:

.github/workflows/test_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
# Upload coverage report to Codecov:
7878
- name: 'Upload coverage to Codecov'
7979
id: upload
80-
uses: codecov/codecov-action@v2
80+
uses: codecov/codecov-action@v3
8181
with:
8282
directory: reports/coverage
8383
flags: unittests

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ Ricky Reusser <[email protected]>
2424
Ryan Seal <[email protected]>
2525
Seyyed Parsa Neshaei <[email protected]>
2626
Shraddheya Shendre <[email protected]>
27+
Stephannie Jimenez Gacha <[email protected]>
2728
dorrin-sot <[email protected]>
2829

LICENSE

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -181,32 +181,6 @@ The library links against the following external libraries or contains
181181
implementations from the following external libraries, which have their own
182182
licenses:
183183

184-
* Boost <http://www.boost.org/LICENSE_1_0.txt>
185-
186-
Boost Software License - Version 1.0 - August 17th, 2003
187-
188-
Permission is hereby granted, free of charge, to any person or organization
189-
obtaining a copy of the software and accompanying documentation covered by
190-
this license (the "Software") to use, reproduce, display, distribute,
191-
execute, and transmit the Software, and to prepare derivative works of the
192-
Software, and to permit third-parties to whom the Software is furnished to
193-
do so, all subject to the following:
194-
195-
The copyright notices in the Software and this entire statement, including
196-
the above license grant, this restriction and the following disclaimer,
197-
must be included in all copies of the Software, in whole or in part, and
198-
all derivative works of the Software, unless such copies or derivative
199-
works are solely in the form of machine-executable object code generated by
200-
a source language processor.
201-
202-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
203-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
204-
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
205-
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
206-
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
207-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
208-
DEALINGS IN THE SOFTWARE.
209-
210184
* MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
211185
mt19937ar.c>
212186

@@ -240,3 +214,29 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
240214
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
241215
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
242216

217+
* Boost <http://www.boost.org/LICENSE_1_0.txt>
218+
219+
Boost Software License - Version 1.0 - August 17th, 2003
220+
221+
Permission is hereby granted, free of charge, to any person or organization
222+
obtaining a copy of the software and accompanying documentation covered by
223+
this license (the "Software") to use, reproduce, display, distribute,
224+
execute, and transmit the Software, and to prepare derivative works of the
225+
Software, and to permit third-parties to whom the Software is furnished to
226+
do so, all subject to the following:
227+
228+
The copyright notices in the Software and this entire statement, including
229+
the above license grant, this restriction and the following disclaimer,
230+
must be included in all copies of the Software, in whole or in part, and
231+
all derivative works of the Software, unless such copies or derivative
232+
works are solely in the form of machine-executable object code generated by
233+
a source language processor.
234+
235+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
236+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
237+
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
238+
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
239+
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
240+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
241+
DEALINGS IN THE SOFTWARE.
242+

docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ interface Namespace {
715715
minstdShuffle: typeof minstdShuffle;
716716

717717
/**
718-
* Returns a pseudorandom integer on the interval `[1, 4294967295]`.
718+
* Returns a pseudorandom integer on the interval `[0, 4294967295]`.
719719
*
720720
* ## Notes
721721
*

0 commit comments

Comments
 (0)