-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (69 loc) · 2.72 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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: 22
registry-url: "https://registry.npmjs.org"
- name: Generate SDK with Updated Version
uses: Bandwidth/[email protected]
with:
openapi-generator-version: 7.10.0
language: typescript-axios
additional-properties: --additional-properties=npmVersion=$PACKAGE_VERSION
- name: Install Packages and Test
run: |
yarn
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & yarn test-unit
shell: bash
- name: Publish npm Package
run: |
npm version $PACKAGE_VERSION --no-git-tag-version --allow-same-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 }}