Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 28, 2022
1 parent 649840b commit 6c1e7dc
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 48 deletions.
165 changes: 119 additions & 46 deletions .github/workflows/productionize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ name: productionize

# Workflow triggers:
on:
# Run workflow when a new commit is pushed to the repository:
# Run workflow when a new commit is pushed to the main branch:
push:
branches:
- main

# Allow the workflow to be manually run:
workflow_dispatch:

# Concurrency group to prevent multiple concurrent executions:
concurrency:
group: productionize
cancel-in-progress: true

# Workflow jobs:
jobs:

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

# Indicate that this job depends on the prior job finishing:
needs: productionize
# Indicate that this job depends on the test job finishing:
needs: test

# Define the sequence of job steps...
steps:
Expand Down Expand Up @@ -309,21 +316,12 @@ jobs:
git add -A
git commit -m "Auto-generated commit"
# Push changes to `deno` branch or create new branch tag:
- name: 'Push changes to `deno` branch or create new branch tag'
# Push changes to `deno` branch:
- name: 'Push changes to `deno` branch'
run: |
SLUG=${{ github.repository }}
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
if [ -z "$VERSION" ]; then
echo "Workflow job was not triggered by a new tag...."
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
else
echo "Workflow job was triggered by a new tag: $VERSION"
echo "Creating new bundle branch tag of the form $VERSION-deno"
git tag -a $VERSION-deno -m "$VERSION-deno"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-deno
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
Expand All @@ -343,8 +341,8 @@ jobs:
# Define the type of virtual host machine on which to run the job:
runs-on: ubuntu-latest

# Indicate that this job depends on the prior job finishing:
needs: productionize
# Indicate that this job depends on the test job finishing:
needs: test

# Define the sequence of job steps...
steps:
Expand Down Expand Up @@ -482,21 +480,12 @@ jobs:
git add -A
git commit -m "Auto-generated commit"
# Push changes to `umd` branch or create new branch tag:
- name: 'Push changes to `umd` branch or create new branch tag'
# Push changes to `umd` branch:
- name: 'Push changes to `umd` branch'
run: |
SLUG=${{ github.repository }}
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
if [ -z "$VERSION" ]; then
echo "Workflow job was not triggered by a new tag...."
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
else
echo "Workflow job was triggered by a new tag: $VERSION"
echo "Creating new bundle branch tag of the form $VERSION-umd"
git tag -a $VERSION-umd -m "$VERSION-umd"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-umd
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
Expand All @@ -516,8 +505,8 @@ jobs:
# Define the type of virtual host machine on which to run the job:
runs-on: ubuntu-latest

# Indicate that this job depends on the prior job finishing:
needs: productionize
# Indicate that this job depends on the test job finishing:
needs: test

# Define the sequence of job steps...
steps:
Expand Down Expand Up @@ -661,21 +650,12 @@ jobs:
git add -A
git commit -m "Auto-generated commit"
# Push changes to `esm` branch or create new branch tag:
- name: 'Push changes to `esm` branch or create new branch tag'
# Push changes to `esm` branch:
- name: 'Push changes to `esm` branch'
run: |
SLUG=${{ github.repository }}
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
if [ -z "$VERSION" ]; then
echo "Workflow job was not triggered by a new tag...."
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm
else
echo "Workflow job was triggered by a new tag: $VERSION"
echo "Creating new bundle branch tag of the form $VERSION-esm"
git tag -a $VERSION-esm -m "$VERSION-esm"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-esm
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
Expand All @@ -685,3 +665,96 @@ jobs:
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

# Define job that succeeds if all bundles were successfully built:
create-tag-bundles:

# Define display name:
name: 'Create tag bundles'

# Define the type of virtual host machine on which to run the job:
runs-on: ubuntu-latest

# Indicate that this job depends on the bundle jobs finishing:
needs: [ deno, umd, esm ]

# Define the steps to be executed:
steps:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
with:
fetch-depth: 2

# Check if workflow run was triggered by a patch, minor, or major version bump:
- name: 'Check if workflow run was triggered by a patch, minor, or major version bump'
id: check-if-bump
continue-on-error: true
run: |
VERSION_CHANGE_PKG_JSON=$(git diff HEAD~1 HEAD package.json | grep '"version":')
if [ -z "$VERSION_CHANGE_PKG_JSON" ]; then
echo "This workflow was not triggered by a version bump."
echo "::set-output name=bump::false"
else
echo "This workflow was triggered by a version bump."
echo "::set-output name=bump::true"
fi
# Configure git:
- name: 'Configure git'
if: steps.check-if-bump.outputs.bump
run: |
git config --local user.email "[email protected]"
git config --local user.name "stdlib-bot"
git fetch --all
# Create bundle tags:
- name: 'Create bundle tags'
if: steps.check-if-bump.outputs.bump
run: |
SLUG=${{ github.repository }}
ESCAPED=$(echo $SLUG | sed -E 's/\//\\\//g')
VERSION="v$(jq --raw-output '.version' package.json)"
git checkout -b deno origin/deno
sed -i -E "s/$ESCAPED@deno/$ESCAPED@$VERSION-deno/g" README.md
git add README.md
git commit -m "Update README.md for Deno bundle $VERSION"
git tag -a $VERSION-deno -m "$VERSION-deno"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-deno
sed -i -E "s/$ESCAPED@$VERSION-deno/$ESCAPED@deno/g" README.md
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
git add README.md
git commit -m "Auto-generated commit"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" deno
git checkout -b umd origin/umd
sed -i -E "s/$ESCAPED@umd/$ESCAPED@$VERSION-umd/g" README.md
git add README.md
git commit -m "Update README.md for UMD bundle $VERSION"
git tag -a $VERSION-umd -m "$VERSION-umd"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-umd
sed -i -E "s/$ESCAPED@$VERSION-umd/$ESCAPED@umd/g" README.md
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
git add README.md
git commit -m "Auto-generated commit"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" umd
git checkout -b esm origin/esm
sed -i -E "s/$ESCAPED@esm/$ESCAPED@$VERSION-esm/g" README.md
git add README.md
git commit -m "Update README.md for ESM bundle $VERSION"
git tag -a $VERSION-esm -m "$VERSION-esm"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" $VERSION-esm
sed -i -E "s/$ESCAPED@$VERSION-esm/$ESCAPED@esm/g" README.md
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
git add README.md
git commit -m "Auto-generated commit"
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" esm
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
# Allow the workflow to be manually run:
workflow_dispatch:

# Run workflow on each push:
# Run workflow on each push to the main branch:
push:

# Workflow jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
# Upload coverage report to Codecov:
- name: 'Upload coverage to Codecov'
id: upload
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
directory: reports/coverage
flags: unittests
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Ricky Reusser <[email protected]>
Ryan Seal <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shraddheya Shendre <[email protected]>
Stephannie Jimenez Gacha <[email protected]>
dorrin-sot <[email protected]>
rei2hu <[email protected]>
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ The namespace includes utilities for validating other special arrays or buffers:
- <span class="signature">[`isBigInt64Array( value )`][@stdlib/assert/is-bigint64array]</span><span class="delimiter">: </span><span class="description">test if a value is a BigInt64Array.</span>
- <span class="signature">[`isBigUint64Array( value )`][@stdlib/assert/is-biguint64array]</span><span class="delimiter">: </span><span class="description">test if a value is a BigUint64Array.</span>
- <span class="signature">[`isCircularArray( value )`][@stdlib/assert/is-circular-array]</span><span class="delimiter">: </span><span class="description">test if a value is an array containing a circular reference.</span>
- <span class="signature">[`isEmptyArrayLikeObject( value )`][@stdlib/assert/is-empty-array-like-object]</span><span class="delimiter">: </span><span class="description">test if a value is an empty array-like object.</span>
- <span class="signature">[`isEmptyArray( value )`][@stdlib/assert/is-empty-array]</span><span class="delimiter">: </span><span class="description">test if a value is an empty array.</span>
- <span class="signature">[`isFalsyArray( value )`][@stdlib/assert/is-falsy-array]</span><span class="delimiter">: </span><span class="description">test if a value is an array-like object containing only falsy values.</span>
- <span class="signature">[`isFiniteArray( value )`][@stdlib/assert/is-finite-array]</span><span class="delimiter">: </span><span class="description">test if a value is an array-like object containing only finite numbers.</span>
Expand Down Expand Up @@ -388,6 +389,7 @@ The remaining namespace utilities are as follows:
- <span class="signature">[`isBetween( value, a, b[, left, right] )`][@stdlib/assert/is-between]</span><span class="delimiter">: </span><span class="description">test if a value is between two values.</span>
- <span class="signature">[`isBigInt( value )`][@stdlib/assert/is-bigint]</span><span class="delimiter">: </span><span class="description">test if a value is a BigInt.</span>
- <span class="signature">[`isBinaryString( value )`][@stdlib/assert/is-binary-string]</span><span class="delimiter">: </span><span class="description">test if a value is a binary string.</span>
- <span class="signature">[`isBlankString( value )`][@stdlib/assert/is-blank-string]</span><span class="delimiter">: </span><span class="description">test if a value is a blank string.</span>
- <span class="signature">[`isBoxedPrimitive( value )`][@stdlib/assert/is-boxed-primitive]</span><span class="delimiter">: </span><span class="description">test if a value is a JavaScript boxed primitive.</span>
- <span class="signature">[`isBuffer( value )`][@stdlib/assert/is-buffer]</span><span class="delimiter">: </span><span class="description">test if a value is a Buffer object.</span>
- <span class="signature">[`isCapitalized( value )`][@stdlib/assert/is-capitalized]</span><span class="delimiter">: </span><span class="description">test if a value is a string having an uppercase first character.</span>
Expand All @@ -403,6 +405,7 @@ The remaining namespace utilities are as follows:
- <span class="signature">[`isDataView( value )`][@stdlib/assert/is-dataview]</span><span class="delimiter">: </span><span class="description">test if a value is a DataView.</span>
- <span class="signature">[`isDigitString( value )`][@stdlib/assert/is-digit-string]</span><span class="delimiter">: </span><span class="description">test whether a string contains only numeric digits.</span>
- <span class="signature">[`isEmailAddress( value )`][@stdlib/assert/is-email-address]</span><span class="delimiter">: </span><span class="description">test if a value is an email address.</span>
- <span class="signature">[`isEmptyCollection( value )`][@stdlib/assert/is-empty-collection]</span><span class="delimiter">: </span><span class="description">test if a value is an empty collection.</span>
- <span class="signature">[`isEmptyObject( value )`][@stdlib/assert/is-empty-object]</span><span class="delimiter">: </span><span class="description">test if a value is an empty object.</span>
- <span class="signature">[`isEmptyString( value )`][@stdlib/assert/is-empty-string]</span><span class="delimiter">: </span><span class="description">test if a value is an empty string.</span>
- <span class="signature">[`isEnumerablePropertyIn( value, property )`][@stdlib/assert/is-enumerable-property-in]</span><span class="delimiter">: </span><span class="description">test if an object's own or inherited property is enumerable.</span>
Expand Down Expand Up @@ -457,6 +460,8 @@ The remaining namespace utilities are as follows:
- <span class="signature">[`isRegExpString( value )`][@stdlib/assert/is-regexp-string]</span><span class="delimiter">: </span><span class="description">test if a value is a regular expression string.</span>
- <span class="signature">[`isRelativePath( value )`][@stdlib/assert/is-relative-path]</span><span class="delimiter">: </span><span class="description">test if a value is a relative path.</span>
- <span class="signature">[`isRelativeURI( value )`][@stdlib/assert/is-relative-uri]</span><span class="delimiter">: </span><span class="description">test whether a value is a relative URI.</span>
- <span class="signature">[`isSameNativeClass( a, b )`][@stdlib/assert/is-same-native-class]</span><span class="delimiter">: </span><span class="description">test if two arguments have the same native class.</span>
- <span class="signature">[`isSameType( a, b )`][@stdlib/assert/is-same-type]</span><span class="delimiter">: </span><span class="description">test if two arguments have the same type.</span>
- <span class="signature">[`isSameValueZero( a, b )`][@stdlib/assert/is-same-value-zero]</span><span class="delimiter">: </span><span class="description">test if two arguments are the same value.</span>
- <span class="signature">[`isSameValue( a, b )`][@stdlib/assert/is-same-value]</span><span class="delimiter">: </span><span class="description">test if two arguments are the same value.</span>
- <span class="signature">[`isStrictEqual( a, b )`][@stdlib/assert/is-strict-equal]</span><span class="delimiter">: </span><span class="description">test if two arguments are strictly equal.</span>
Expand Down Expand Up @@ -621,6 +626,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

[@stdlib/assert/is-binary-string]: https://github.com/stdlib-js/assert/tree/main/is-binary-string

[@stdlib/assert/is-blank-string]: https://github.com/stdlib-js/assert/tree/main/is-blank-string

[@stdlib/assert/is-boxed-primitive]: https://github.com/stdlib-js/assert/tree/main/is-boxed-primitive

[@stdlib/assert/is-buffer]: https://github.com/stdlib-js/assert/tree/main/is-buffer
Expand Down Expand Up @@ -649,6 +656,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

[@stdlib/assert/is-email-address]: https://github.com/stdlib-js/assert/tree/main/is-email-address

[@stdlib/assert/is-empty-collection]: https://github.com/stdlib-js/assert/tree/main/is-empty-collection

[@stdlib/assert/is-empty-object]: https://github.com/stdlib-js/assert/tree/main/is-empty-object

[@stdlib/assert/is-empty-string]: https://github.com/stdlib-js/assert/tree/main/is-empty-string
Expand Down Expand Up @@ -757,6 +766,10 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

[@stdlib/assert/is-relative-uri]: https://github.com/stdlib-js/assert/tree/main/is-relative-uri

[@stdlib/assert/is-same-native-class]: https://github.com/stdlib-js/assert/tree/main/is-same-native-class

[@stdlib/assert/is-same-type]: https://github.com/stdlib-js/assert/tree/main/is-same-type

[@stdlib/assert/is-same-value-zero]: https://github.com/stdlib-js/assert/tree/main/is-same-value-zero

[@stdlib/assert/is-same-value]: https://github.com/stdlib-js/assert/tree/main/is-same-value
Expand Down Expand Up @@ -909,6 +922,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

[@stdlib/assert/is-circular-array]: https://github.com/stdlib-js/assert/tree/main/is-circular-array

[@stdlib/assert/is-empty-array-like-object]: https://github.com/stdlib-js/assert/tree/main/is-empty-array-like-object

[@stdlib/assert/is-empty-array]: https://github.com/stdlib-js/assert/tree/main/is-empty-array

[@stdlib/assert/is-falsy-array]: https://github.com/stdlib-js/assert/tree/main/is-falsy-array
Expand Down

0 comments on commit 6c1e7dc

Please sign in to comment.