Skip to content

Commit 7047e96

Browse files
committed
Auto-generated commit
1 parent 05aad9b commit 7047e96

File tree

6 files changed

+93
-147
lines changed

6 files changed

+93
-147
lines changed

.github/.keepalive

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-08-01T01:07:31.702Z

.github/workflows/bundle_tags.yml

-125
This file was deleted.

.github/workflows/productionize.yml

+88-19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
# Allow the workflow to be manually run:
3030
workflow_dispatch:
3131

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

@@ -170,8 +175,8 @@ jobs:
170175
# Define the type of virtual host machine on which to run the job:
171176
runs-on: ubuntu-latest
172177

173-
# Indicate that this job depends on the prior job finishing:
174-
needs: productionize
178+
# Indicate that this job depends on the test job finishing:
179+
needs: test
175180

176181
# Define the sequence of job steps...
177182
steps:
@@ -336,8 +341,8 @@ jobs:
336341
# Define the type of virtual host machine on which to run the job:
337342
runs-on: ubuntu-latest
338343

339-
# Indicate that this job depends on the prior job finishing:
340-
needs: productionize
344+
# Indicate that this job depends on the test job finishing:
345+
needs: test
341346

342347
# Define the sequence of job steps...
343348
steps:
@@ -500,8 +505,8 @@ jobs:
500505
# Define the type of virtual host machine on which to run the job:
501506
runs-on: ubuntu-latest
502507

503-
# Indicate that this job depends on the prior job finishing:
504-
needs: productionize
508+
# Indicate that this job depends on the test job finishing:
509+
needs: test
505510

506511
# Define the sequence of job steps...
507512
steps:
@@ -662,30 +667,94 @@ jobs:
662667
if: failure()
663668

664669
# Define job that succeeds if all bundles were successfully built:
665-
productionize-status:
670+
create-tag-bundles:
666671

667672
# Define display name:
668-
name: 'Productionize status'
673+
name: 'Create tag bundles'
669674

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

673-
# Indicate that this job depends on the prior jobs finishing:
678+
# Indicate that this job depends on the bundle jobs finishing:
674679
needs: [ deno, umd, esm ]
675680

676681
# Define the steps to be executed:
677682
steps:
678683

679-
- name: 'If all bundles were successfully generated...'
680-
if: always() && (needs.deno.result == 'success' && needs.umd.result == 'success' && needs.esm.result == 'success')
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
681694
run: |
682-
echo "All bundles were successfully built."
683-
echo "Success!"
684-
exit 0
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
685703
686-
- name: 'If any bundle failed to be generated...'
687-
if: always() && (needs.deno.result == 'failure' || needs.umd.result == 'failure' || needs.esm.result == 'failure')
704+
# Configure git:
705+
- name: 'Configure git'
706+
if: steps.check-if-bump.outputs.bump
688707
run: |
689-
echo "One or more bundles failed to be generated."
690-
echo "Failure!"
691-
exit 1
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_coverage.yml

+1-1
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

+1
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

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
293293
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-substring-after.svg
294294
[npm-url]: https://npmjs.org/package/@stdlib/string-substring-after
295295

296-
[test-image]: https://github.com/stdlib-js/string-substring-after/actions/workflows/test.yml/badge.svg?branch=v0.0.2
297-
[test-url]: https://github.com/stdlib-js/string-substring-after/actions/workflows/test.yml?query=branch:v0.0.2
296+
[test-image]: https://github.com/stdlib-js/string-substring-after/actions/workflows/test.yml/badge.svg?branch=main
297+
[test-url]: https://github.com/stdlib-js/string-substring-after/actions/workflows/test.yml?query=branch:main
298298

299299
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-substring-after/main.svg
300300
[coverage-url]: https://codecov.io/github/stdlib-js/string-substring-after?branch=main

0 commit comments

Comments
 (0)