Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c362cd9
commit be1195a
Showing
5 changed files
with
173 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters