Skip to content

v13.1.3

v13.1.3 #54

Workflow file for this run

name: Deploy SDK
on:
release:
types:
- published
jobs:
deploy:
name: Deploy SDK to Rubygems
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 }}
RUBY_VERSION: "3.0"
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}
re=[0-9]+\.[0-9]+\.[0-9]+
if [[ $RELEASE_VERSION =~ $re ]]; then
echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
else
echo "Tag does not match expected semver regex pattern (v$re)"
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 Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
- name: Update Gem Version
run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb
- name: Install Packages and Test
run: |
npm install -g @stoplight/prism-cli
bundle install
prism mock ./bandwidth.yml & (sleep 3; rake unit)
shell: bash
- name: Deploy to Rubygems
run: |
mkdir ~/.gem
touch ~/.gem/credentials
chmod 0600 ~/.gem/credentials
printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials
gem build *.gemspec
gem push *.gem
- uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}