Skip to content

Commit

Permalink
Release v0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 12, 2022
1 parent c362cd9 commit be1195a
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 44 deletions.
125 changes: 125 additions & 0 deletions .github/workflows/bundle_tags.yml
@@ -0,0 +1,125 @@

#/
# @license Apache-2.0
#
# Copyright (c) 2022 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/

# Workflow name:
name: bundle_tags

# Workflow triggers:
on:
# Run workflow when a new tag is pushed to the repository:
push:
tags:
- '*'

# Workflow jobs:
jobs:

# Define job to wait a minute before running the workflow...
waiting:

# Define display name:
name: 'Waiting Period'

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

# Define the steps to run:
steps:

# Wait three minutes:
- name: 'Wait three minutes'
run: |
sleep 3m
# Define job to publish bundle tags to GitHub...
create-tags:

# Define display name:
name: 'Create bundle tags'

# 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: waiting

# Define the steps to run:
steps:

# Wait for the productionize workflow to succeed:
- name: 'Wait for productionize workflow to succeed'
uses: lewagon/wait-on-check-action@v1.0.0
timeout-minutes: 5
with:
ref: main
check-regexp: 'Productionize'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
allowed-conclusions: success

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3

# Configure git:
- name: 'Configure git'
run: |
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'
run: |
SLUG=${{ github.repository }}
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
ESCAPED=$(echo $SLUG | sed -E 's/\//\\\//g')
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
git add README.md
git commit -m "Revert changes to README.md for Deno bundle $VERSION"
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
git add README.md
git commit -m "Revert changes to README.md for UMD bundle $VERSION"
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
git add README.md
git commit -m "Revert changes to README.md for ESM bundle $VERSION"
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" esm
84 changes: 44 additions & 40 deletions .github/workflows/productionize.yml
Expand Up @@ -21,8 +21,10 @@ 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:
Expand Down Expand Up @@ -309,21 +311,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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-deno
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
Expand Down Expand Up @@ -482,21 +475,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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-umd
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" umd
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
Expand Down Expand Up @@ -661,21 +645,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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-esm
fi
echo "Pushing changes to $SLUG..."
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$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 +660,32 @@ jobs:
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

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

# Define display name:
name: 'Productionize status'

# 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:
needs: [ deno, umd, esm ]

# Define the steps to be executed:
steps:

- name: 'If all bundles were successfully generated...'
if: always() && (needs.deno.result == 'success' && needs.umd.result == 'success' && needs.esm.result == 'success')
run: |
echo "All bundles were successfully built."
echo "Success!"
exit 0
- name: 'If any bundle failed to be generated...'
if: always() && (needs.deno.result == 'failure' || needs.umd.result == 'failure' || needs.esm.result == 'failure')
run: |
echo "One or more bundles failed to be generated."
echo "Failure!"
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
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
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -288,8 +288,8 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-from-code-point.svg
[npm-url]: https://npmjs.org/package/@stdlib/string-from-code-point

[test-image]: https://github.com/stdlib-js/string-from-code-point/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/string-from-code-point/actions/workflows/test.yml?query=branch:main
[test-image]: https://github.com/stdlib-js/string-from-code-point/actions/workflows/test.yml/badge.svg?branch=v0.0.9
[test-url]: https://github.com/stdlib-js/string-from-code-point/actions/workflows/test.yml?query=branch:v0.0.9

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-from-code-point/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/string-from-code-point?branch=main
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@stdlib/string-from-code-point",
"version": "0.0.8",
"version": "0.0.9",
"description": "Create a string from a sequence of Unicode code points.",
"license": "Apache-2.0",
"author": {
Expand Down

0 comments on commit be1195a

Please sign in to comment.