Deploy SDK #2
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: Deploy SDK | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
deploy: | |
name: Deploy SDK to NPM | |
runs-on: ubuntu-latest | |
env: | |
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | |
BW_USERNAME: ${{ secrets.BW_USERNAME }} | |
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | |
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} | |
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} | |
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | |
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | |
BW_NUMBER: ${{ secrets.BW_NUMBER }} | |
USER_NUMBER: ${{ secrets.USER_NUMBER }} | |
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | |
OPERATING_SYSTEM: "ubuntu" | |
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | |
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | |
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | |
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | |
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} | |
steps: | |
- name: Set Release Version | |
run: | | |
RELEASE_VERSION=${GITHUB_REF#refs/tags/v} | |
if [[ $RELEASE_VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)?$ ]]; then | |
echo "PACKAGE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
else | |
echo 'Tag does not match expected semver regex pattern (^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)?$)' | |
echo $RELEASE_VERSION | |
echo 'Please update your tag to match the expected regex pattern' | |
exit 1 | |
fi | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install Packages and Test | |
run: | | |
npm i | |
npm test | |
- name: Publish npm Package | |
run: | | |
npm version $PACKAGE_VERSION --no-git-tag-version | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- uses: Bandwidth/[email protected] | |
if: always() | |
with: | |
job-status: ${{ job.status }} | |
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-channel: ${{ secrets.SLACK_CHANNEL }} |