-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (163 loc) · 6.65 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Deploy
on:
release:
types:
- published
jobs:
deploy_pre_release:
name: Deploy OpenAPI Generator Client Pre-Release to Maven
if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }}
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 }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
PYTHON_VERSION: ${{ matrix.python-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
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: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Check Release Tag 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: Checkout
uses: actions/checkout@v4
with:
ref: feature/openapi-generator-sdk
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build SDK
uses: Bandwidth/[email protected]
with:
openapi-generator-version: 7.10.0
language: java
additional-properties: --additional-properties=artifactVersion=$RELEASE_VERSION
- name: Clean SDK
run: mvn clean
- name: Set Maven Project Version
run: mvn versions:set -DnewVersion=$RELEASE_VERSION
- name: Build Package and Test
env:
JAVA_VERSION: 21
RUNNER_OS: ubuntu-latest
OPERATING_SYSTEM: ubuntu -latest
DISTRIBUTION: adopt
run: |
mvn -B package --file pom.xml -DskipTests
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & (sleep 3; mvn test -Punit-tests)
shell: bash
- name: Publish to Apache Maven Central
run: mvn deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
publish:
if: ${{ !github.event.release.prerelease }}
env:
# Integration test environment variables.
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 }}
VZW_NUMBER: ${{ secrets.VZW_NUMBER }}
ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
PYTHON_VERSION: ${{ matrix.python-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
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 }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21
server-id: 'ossrh'
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Get Maven Project Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Build SDK
uses: Bandwidth/[email protected]
with:
openapi-generator-version: 7.9.0
language: java
additional-properties: --additional-properties=artifactVersion=$RELEASE_VERSION
- name: Clean SDK
run: mvn clean
- name: Set Maven Project Version
run: mvn versions:set -DnewVersion=$RELEASE_VERSION
- name: Build Package and Test
env:
JAVA_VERSION: 21
RUNNER_OS: ubuntu-latest
OPERATING_SYSTEM: ubuntu -latest
DISTRIBUTION: adopt
run: |
mvn -B package --file pom.xml -DskipTests
npm install -g @stoplight/prism-cli
prism mock ./bandwidth.yml & (sleep 3; mvn test -Punit-tests)
shell: bash
- name: Publish to Apache Maven Central
run: mvn deploy -DskipTests
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Notify Slack
uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}