Package SDK for Bower #542
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
name: Package SDK for Bower | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 12 * * *' # daily @ noon | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout JS SDK | |
uses: actions/checkout@v2 | |
with: | |
repository: stellar/js-stellar-sdk | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Checkout Bower | |
uses: actions/checkout@v2 | |
with: | |
repository: stellar/bower-js-stellar-sdk | |
fetch-depth: 0 | |
ref: master | |
path: bower | |
# if this check fails then the job doesn't need to proceed | |
- name: Check for updated SDK | |
shell: bash | |
run: | | |
TAG=`git describe --tags` | |
cd bower/ | |
OLDTAG=`git describe --abbrev=0 --tags` | |
if [ "$OLDTAG" == "$TAG" ]; then | |
echo "No new JavaScript SDK version was found, skipping run." | |
exit 1 | |
else | |
echo "::group::New JavaScript SDK version found:" | |
echo "Previous version: $OLDTAG" | |
echo "New version: $TAG" | |
echo "::endgroup::" | |
fi | |
- name: Install Node (18.x) | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.x' | |
- name: Install and build package | |
run: | | |
yarn install | |
yarn | |
cp dist/* bower/ | |
- name: Publish package | |
run: | | |
TAG=`git describe --tags` | |
cd bower/ | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m $TAG | |
git tag -a $TAG -m $TAG | |
git push --atomic origin master "$TAG" |