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 Aug 1, 2022
1 parent b5ebc41 commit 5e09d2f
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 125 deletions.
1 change: 1 addition & 0 deletions .github/.keepalive
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-08-01T00:37:22.743Z
102 changes: 0 additions & 102 deletions .github/workflows/bundle_tags.yml

This file was deleted.

107 changes: 88 additions & 19 deletions .github/workflows/productionize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
# 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 @@ -170,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 @@ -336,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 @@ -500,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 @@ -662,30 +667,94 @@ jobs:
if: failure()

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

# Define display name:
name: 'Productionize status'
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 prior jobs finishing:
# Indicate that this job depends on the bundle jobs finishing:
needs: [ deno, umd, esm ]

# Define the steps to be executed:
steps:

- name: 'If all bundles were successfully generated...'
if: always() && (needs.bundle-deno.result == 'success' && needs.bundle-umd.result == 'success' && needs.bundle-esm.result == 'success')
# 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: |
echo "All bundles were successfully built."
echo "Success!"
exit 0
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
- name: 'If any bundle failed to be generated...'
if: always() && (needs.deno.result == 'failure' || needs.umd.result == 'failure' || needs.esm.result == 'failure')
# Configure git:
- name: 'Configure git'
if: steps.check-if-bump.outputs.bump
run: |
echo "One or more bundles failed to be generated."
echo "Failure!"
exit 1
git config --local user.email "noreply@stdlib.io"
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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$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 <rsreusser@gmail.com>
Ryan Seal <splrk@users.noreply.github.com>
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
Shraddheya Shendre <shendreshraddheya@gmail.com>
Stephannie Jimenez Gacha <steff456@users.noreply.github.com>
dorrin-sot <59933477+dorrin-sot@users.noreply.github.com>
rei2hu <rei2hu@users.noreply.github.com>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/stats-base-meanwd.svg
[npm-url]: https://npmjs.org/package/@stdlib/stats-base-meanwd

[test-image]: https://github.com/stdlib-js/stats-base-meanwd/actions/workflows/test.yml/badge.svg?branch=v0.0.9
[test-url]: https://github.com/stdlib-js/stats-base-meanwd/actions/workflows/test.yml?query=branch:v0.0.9
[test-image]: https://github.com/stdlib-js/stats-base-meanwd/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/stats-base-meanwd/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-meanwd/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/stats-base-meanwd?branch=main
Expand Down

0 comments on commit 5e09d2f

Please sign in to comment.