Skip to content

Commit 12908d0

Browse files
committed
Release v0.0.8
1 parent f6fc08d commit 12908d0

File tree

5 files changed

+173
-44
lines changed

5 files changed

+173
-44
lines changed

.github/workflows/bundle_tags.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
#/
3+
# @license Apache-2.0
4+
#
5+
# Copyright (c) 2022 The Stdlib Authors.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#/
19+
20+
# Workflow name:
21+
name: bundle_tags
22+
23+
# Workflow triggers:
24+
on:
25+
# Run workflow when a new tag is pushed to the repository:
26+
push:
27+
tags:
28+
- '*'
29+
30+
# Workflow jobs:
31+
jobs:
32+
33+
# Define job to wait a minute before running the workflow...
34+
waiting:
35+
36+
# Define display name:
37+
name: 'Waiting Period'
38+
39+
# Define the type of virtual host machine on which to run the job:
40+
runs-on: ubuntu-latest
41+
42+
# Define the steps to run:
43+
steps:
44+
45+
# Wait three minutes:
46+
- name: 'Wait three minutes'
47+
run: |
48+
sleep 3m
49+
50+
# Define job to publish bundle tags to GitHub...
51+
create-tags:
52+
53+
# Define display name:
54+
name: 'Create bundle tags'
55+
56+
# Define the type of virtual host machine on which to run the job:
57+
runs-on: ubuntu-latest
58+
59+
# Indicate that this job depends on the prior job finishing:
60+
needs: waiting
61+
62+
# Define the steps to run:
63+
steps:
64+
65+
# Wait for the productionize workflow to succeed:
66+
- name: 'Wait for productionize workflow to succeed'
67+
uses: lewagon/wait-on-check-action@v1.0.0
68+
timeout-minutes: 5
69+
with:
70+
ref: main
71+
check-regexp: 'Productionize'
72+
repo-token: ${{ secrets.GITHUB_TOKEN }}
73+
wait-interval: 60
74+
allowed-conclusions: success
75+
76+
# Checkout the repository:
77+
- name: 'Checkout repository'
78+
uses: actions/checkout@v3
79+
80+
# Configure git:
81+
- name: 'Configure git'
82+
run: |
83+
git config --local user.email "noreply@stdlib.io"
84+
git config --local user.name "stdlib-bot"
85+
git fetch --all
86+
87+
# Create bundle tags:
88+
- name: 'Create bundle tags'
89+
run: |
90+
SLUG=${{ github.repository }}
91+
VERSION=$(echo ${{ github.ref }} | sed -E -n 's/refs\/tags\/?(v[0-9]+.[0-9]+.[0-9]+).*/\1/p')
92+
ESCAPED=$(echo $SLUG | sed -E 's/\//\\\//g')
93+
94+
git checkout -b deno origin/deno
95+
sed -i -E "s/$ESCAPED@deno/$ESCAPED@$VERSION-deno/g" README.md
96+
git add README.md
97+
git commit -m "Update README.md for Deno bundle $VERSION"
98+
git tag -a $VERSION-deno -m "$VERSION-deno"
99+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-deno
100+
sed -i -E "s/$ESCAPED@$VERSION-deno/$ESCAPED@deno/g" README.md
101+
git add README.md
102+
git commit -m "Revert changes to README.md for Deno bundle $VERSION"
103+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
104+
105+
git checkout -b umd origin/umd
106+
sed -i -E "s/$ESCAPED@umd/$ESCAPED@$VERSION-umd/g" README.md
107+
git add README.md
108+
git commit -m "Update README.md for UMD bundle $VERSION"
109+
git tag -a $VERSION-umd -m "$VERSION-umd"
110+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-umd
111+
sed -i -E "s/$ESCAPED@$VERSION-umd/$ESCAPED@umd/g" README.md
112+
git add README.md
113+
git commit -m "Revert changes to README.md for UMD bundle $VERSION"
114+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" umd
115+
116+
git checkout -b esm origin/esm
117+
sed -i -E "s/$ESCAPED@esm/$ESCAPED@$VERSION-esm/g" README.md
118+
git add README.md
119+
git commit -m "Update README.md for ESM bundle $VERSION"
120+
git tag -a $VERSION-esm -m "$VERSION-esm"
121+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-esm
122+
sed -i -E "s/$ESCAPED@$VERSION-esm/$ESCAPED@esm/g" README.md
123+
git add README.md
124+
git commit -m "Revert changes to README.md for ESM bundle $VERSION"
125+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" esm

.github/workflows/productionize.yml

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ 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:
@@ -309,21 +311,12 @@ jobs:
309311
git add -A
310312
git commit -m "Auto-generated commit"
311313
312-
# Push changes to `deno` branch or create new branch tag:
313-
- name: 'Push changes to `deno` branch or create new branch tag'
314+
# Push changes to `deno` branch:
315+
- name: 'Push changes to `deno` branch'
314316
run: |
315317
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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-deno
326-
fi
318+
echo "Pushing changes to $SLUG..."
319+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
327320
328321
# Send status to Slack channel if job fails:
329322
- name: 'Send status to Slack channel in case of failure'
@@ -482,21 +475,12 @@ jobs:
482475
git add -A
483476
git commit -m "Auto-generated commit"
484477
485-
# Push changes to `umd` branch or create new branch tag:
486-
- name: 'Push changes to `umd` branch or create new branch tag'
478+
# Push changes to `umd` branch:
479+
- name: 'Push changes to `umd` branch'
487480
run: |
488481
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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-umd
499-
fi
482+
echo "Pushing changes to $SLUG..."
483+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" umd
500484
501485
# Send status to Slack channel if job fails:
502486
- name: 'Send status to Slack channel in case of failure'
@@ -661,21 +645,12 @@ jobs:
661645
git add -A
662646
git commit -m "Auto-generated commit"
663647
664-
# Push changes to `esm` branch or create new branch tag:
665-
- name: 'Push changes to `esm` branch or create new branch tag'
648+
# Push changes to `esm` branch:
649+
- name: 'Push changes to `esm` branch'
666650
run: |
667651
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:$GITHUB_TOKEN@github.com/$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:$GITHUB_TOKEN@github.com/$SLUG.git" $VERSION-esm
678-
fi
652+
echo "Pushing changes to $SLUG..."
653+
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" esm
679654
680655
# Send status to Slack channel if job fails:
681656
- name: 'Send status to Slack channel in case of failure'
@@ -685,3 +660,32 @@ jobs:
685660
steps: ${{ toJson(steps) }}
686661
channel: '#npm-ci'
687662
if: failure()
663+
664+
# Define job that succeeds if all bundles were successfully built:
665+
productionize-status:
666+
667+
# Define display name:
668+
name: 'Productionize status'
669+
670+
# Define the type of virtual host machine on which to run the job:
671+
runs-on: ubuntu-latest
672+
673+
# Indicate that this job depends on the prior jobs finishing:
674+
needs: [ deno, umd, esm ]
675+
676+
# Define the steps to be executed:
677+
steps:
678+
679+
- name: 'If all bundles were successfully generated...'
680+
if: always() && (needs.deno.result == 'success' && needs.umd.result == 'success' && needs.esm.result == 'success')
681+
run: |
682+
echo "All bundles were successfully built."
683+
echo "Success!"
684+
exit 0
685+
686+
- name: 'If any bundle failed to be generated...'
687+
if: always() && (needs.deno.result == 'failure' || needs.umd.result == 'failure' || needs.esm.result == 'failure')
688+
run: |
689+
echo "One or more bundles failed to be generated."
690+
echo "Failure!"
691+
exit 1

.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:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
177177
[npm-image]: http://img.shields.io/npm/v/@stdlib/number-uint8-base-to-binary-string.svg
178178
[npm-url]: https://npmjs.org/package/@stdlib/number-uint8-base-to-binary-string
179179

180-
[test-image]: https://github.com/stdlib-js/number-uint8-base-to-binary-string/actions/workflows/test.yml/badge.svg?branch=main
181-
[test-url]: https://github.com/stdlib-js/number-uint8-base-to-binary-string/actions/workflows/test.yml?query=branch:main
180+
[test-image]: https://github.com/stdlib-js/number-uint8-base-to-binary-string/actions/workflows/test.yml/badge.svg?branch=v0.0.8
181+
[test-url]: https://github.com/stdlib-js/number-uint8-base-to-binary-string/actions/workflows/test.yml?query=branch:v0.0.8
182182

183183
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/number-uint8-base-to-binary-string/main.svg
184184
[coverage-url]: https://codecov.io/github/stdlib-js/number-uint8-base-to-binary-string?branch=main

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/number-uint8-base-to-binary-string",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Return a string giving the literal bit representation of an unsigned 8-bit integer.",
55
"license": "Apache-2.0",
66
"author": {

0 commit comments

Comments
 (0)