|
4 | 4 | types:
|
5 | 5 | - published
|
6 | 6 |
|
7 |
| -env: |
8 |
| - OPENAPI_GENERATOR_VERSION: 7.10.0 |
9 |
| - |
10 | 7 | jobs:
|
11 |
| - deploy_pre_release: |
12 |
| - name: Deploy OpenAPI Generator Client Pre-Release to Maven |
13 |
| - if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }} |
14 |
| - runs-on: ubuntu-latest |
15 |
| - env: |
16 |
| - BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} |
17 |
| - BW_USERNAME: ${{ secrets.BW_USERNAME }} |
18 |
| - BW_PASSWORD: ${{ secrets.BW_PASSWORD }} |
19 |
| - BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} |
20 |
| - BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} |
21 |
| - BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} |
22 |
| - BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} |
23 |
| - BW_NUMBER: ${{ secrets.BW_NUMBER }} |
24 |
| - USER_NUMBER: ${{ secrets.USER_NUMBER }} |
25 |
| - VZW_NUMBER: ${{ secrets.VZW_NUMBER }} |
26 |
| - ATT_NUMBER: ${{ secrets.ATT_NUMBER }} |
27 |
| - T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }} |
28 |
| - BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} |
29 |
| - PYTHON_VERSION: ${{ matrix.python-version }} |
30 |
| - OPERATING_SYSTEM: ${{ matrix.os }} |
31 |
| - MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} |
32 |
| - MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} |
33 |
| - MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} |
34 |
| - MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} |
35 |
| - BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} |
36 |
| - |
37 |
| - steps: |
38 |
| - - name: Set Release Version |
39 |
| - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV |
40 |
| - |
41 |
| - - name: Check Release Tag Format |
42 |
| - run: | |
43 |
| - re=[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+ |
44 |
| - if ! [[ $RELEASE_VERSION =~ $re ]]; then |
45 |
| - echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+)' |
46 |
| - echo $RELEASE_VERSION |
47 |
| - echo 'Please update your tag to match the expected regex pattern' |
48 |
| - exit 1 |
49 |
| - fi |
50 |
| -
|
51 |
| - - name: Checkout |
52 |
| - uses: actions/checkout@v4 |
53 |
| - with: |
54 |
| - ref: feature/openapi-generator-sdk |
55 |
| - |
56 |
| - - name: Set up Apache Maven Central |
57 |
| - uses: actions/setup-java@v4 |
58 |
| - with: |
59 |
| - distribution: 'adopt' |
60 |
| - java-version: 21 |
61 |
| - server-id: ossrh |
62 |
| - server-username: MAVEN_USERNAME |
63 |
| - server-password: MAVEN_CENTRAL_TOKEN |
64 |
| - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
65 |
| - gpg-passphrase: MAVEN_GPG_PASSPHRASE |
66 |
| - |
67 |
| - - name: Build SDK |
68 |
| - |
69 |
| - with: |
70 |
| - openapi-generator-version: ${{ env.OPENAPI_GENERATOR_VERSION }} |
71 |
| - language: java |
72 |
| - additional-properties: --additional-properties=artifactVersion=$RELEASE_VERSION |
73 |
| - |
74 |
| - - name: Clean SDK |
75 |
| - run: mvn clean |
76 |
| - |
77 |
| - - name: Set Maven Project Version |
78 |
| - run: mvn versions:set -DnewVersion=$RELEASE_VERSION |
79 |
| - |
80 |
| - - name: Build Package and Test |
81 |
| - env: |
82 |
| - JAVA_VERSION: 21 |
83 |
| - RUNNER_OS: ubuntu-latest |
84 |
| - OPERATING_SYSTEM: ubuntu -latest |
85 |
| - DISTRIBUTION: adopt |
86 |
| - run: | |
87 |
| - mvn -B package --file pom.xml -DskipTests |
88 |
| - npm install -g @stoplight/prism-cli |
89 |
| - prism mock ./bandwidth.yml & (sleep 3; mvn test -Punit-tests) |
90 |
| - shell: bash |
91 |
| - |
92 |
| - - name: Publish to Apache Maven Central |
93 |
| - run: mvn deploy -DskipTests |
94 |
| - env: |
95 |
| - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} |
96 |
| - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} |
97 |
| - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
98 |
| - |
99 |
| - - uses: Bandwidth/[email protected] |
100 |
| - if: always() |
101 |
| - with: |
102 |
| - job-status: ${{ job.status }} |
103 |
| - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} |
104 |
| - slack-channel: ${{ secrets.SLACK_CHANNEL }} |
105 |
| - |
106 | 8 | publish:
|
107 |
| - if: ${{ !github.event.release.prerelease }} |
108 | 9 | env:
|
109 |
| - # Integration test environment variables. |
110 | 10 | BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
|
111 | 11 | BW_USERNAME: ${{ secrets.BW_USERNAME }}
|
112 | 12 | BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
|
@@ -145,6 +45,12 @@ jobs:
|
145 | 45 | - name: Get Maven Project Version
|
146 | 46 | run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
|
147 | 47 |
|
| 48 | + - name: Set OpenAPI Generator Version |
| 49 | + run: | |
| 50 | + OPENAPI_VERSION=$(jq .["generator-cli"].version openapitools.json) |
| 51 | + echo "OPENAPI_GENERATOR_VERSION=$OPENAPI_VERSION" >> $GITHUB_ENV |
| 52 | + shell: bash |
| 53 | + |
148 | 54 | - name: Build SDK
|
149 | 55 |
|
150 | 56 | with:
|
|
0 commit comments