v6.1.1 #26
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 Beta | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy_beta: | |
name: Deploy Beta | |
runs-on: ubuntu-latest | |
if: ${{ github.event.release.prerelease }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check Branch Name Format | |
run: | | |
re=v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+ | |
if ! [[ ${{ github.event.release.target_commitish }} =~ $re ]]; then | |
echo 'Target branch does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+)' | |
echo '${{ github.event.release.target_commitish }}' | |
echo 'Please update your branch name to match the expected regex pattern' | |
exit 1 | |
fi | |
- name: Set Release Version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
- name: Check Release Version Format | |
run: | | |
re=[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+ | |
if ! [[ $RELEASE_VERSION =~ $re ]]; then | |
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+)' | |
echo $RELEASE_VERSION | |
echo 'Please update your tag to match the expected regex pattern' | |
exit 1 | |
fi | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Build and Test npm Package | |
run: | | |
npm install | |
npm run build | |
npm run test --if-present | |
env: | |
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | |
BW_USERNAME: ${{ secrets.BW_USERNAME }} | |
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | |
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 }} | |
- name: Publish npm Package | |
run: | | |
npm version $RELEASE_VERSION --no-git-tag-version | |
npm publish --access public --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |