Release amazon-chime-sdk-3.26.0 #133
Workflow file for this run
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: Publish | |
# When a new Github Release is created, publish to NPM | |
on: | |
release: | |
types: [published] | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Package | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Setup Node environment | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
- name: NPM Install | |
run: npm install | |
- name: NPM run build | |
run: npm run build | |
- name: Get npm tag name | |
id: npm_tag | |
run: | | |
npm_publish_tag=$(.github/script/get-npm-tag.js) | |
echo "Received NPM publish tag:" $npm_publish_tag | |
echo "npm_tag=$npm_publish_tag" >> $GITHUB_OUTPUT | |
- name: Publish to NPM with tag | |
run: npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
deploy_chime_prod_demo: | |
needs: publish | |
name: Deploy Meeting Demos with the latest NPM release | |
runs-on: ubuntu-latest | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
AWS_DEFAULT_OUTPUT: text | |
NAME: PROD | |
steps: | |
- name: Verify the npm version is available | |
id: npm_version | |
run: | | |
tag_name=${{ github.event.release.tag_name }} | |
current_version=${tag_name:1} | |
max_wait_time=300 | |
wait_time=0 | |
sleep_time=60 | |
while : | |
do | |
if [[ $wait_time -ge $max_wait_time ]] | |
then | |
echo "Version is not published to npm:" $current_version | |
exit 1 | |
fi | |
echo $wait_time | |
npm_version=$(npm view amazon-chime-sdk-js@${current_version} version) | |
if [[ *$npm_version* = *$current_version* ]] | |
then | |
echo "Version is published to npm:" $current_version | |
echo "npm_version=$current_version" >> $GITHUB_OUTPUT | |
break | |
fi | |
sleep $sleep_time | |
wait_time=$((wait_time+sleep_time)) | |
done | |
shell: bash | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_CANARY_PROD }} | |
role-session-name: publish-demo-deployment | |
aws-region: us-east-1 | |
- name: Checkout Package | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Install SDK | |
run: | | |
cd demos/browser | |
npm uninstall amazon-chime-sdk-js | |
npm install amazon-chime-sdk-js@${{ steps.npm_version.outputs.npm_version }} | |
- name: Verify demo browser npm version and run deployment script | |
run: | | |
demo_current_version=$(.github/script/get-demo-browser-current-version) | |
echo "Current demo version: " $demo_current_version | |
script/github-action-awscli-installation | |
node ./.github/script/call-canary-deploy-demo-prod $demo_current_version |