|
43 | 43 | required: false |
44 | 44 | jira_api_token: |
45 | 45 | required: true |
| 46 | + mms_deployed_sha_url: |
| 47 | + required: true |
46 | 48 |
|
47 | 49 | permissions: |
48 | 50 | contents: write |
|
85 | 87 | spectral_version: ${{ vars.SPECTRAL_VERSION }} |
86 | 88 |
|
87 | 89 | release: |
88 | | - name: Release OpenAPI Spec |
| 90 | + name: Release OpenAPI Spec for V2 APIs |
89 | 91 | runs-on: ubuntu-latest |
90 | 92 | needs: [run-required-validations] |
91 | 93 | outputs: |
@@ -152,7 +154,58 @@ jobs: |
152 | 154 | commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |
153 | 155 | branch: ${{env.target_branch}} |
154 | 156 | file_pattern: "openapi/*" |
155 | | - |
| 157 | + |
| 158 | + release-v1-oas-apis: |
| 159 | + name: Release OpenAPI Spec for V1 (DEPRECATED) APIs |
| 160 | + runs-on: ubuntu-latest |
| 161 | + steps: |
| 162 | + - name: Download v1 Spec |
| 163 | + env: |
| 164 | + AWS_DEFAULT_REGION: ${{inputs.aws_default_region}} |
| 165 | + AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} |
| 166 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} |
| 167 | + S3_BUCKET: ${{ inputs.aws_s3_bucket }} |
| 168 | + MMS_DEPLOYED_SHA_URL: ${{secrets.mms_deployed_sha_url}} |
| 169 | + run: | |
| 170 | + sha=$(curl "${MMS_DEPLOYED_SHA_URL}") |
| 171 | + echo "Downloading the OpenAPI Spec for v1 with sha ${sha}" |
| 172 | + aws s3 cp "s3://${S3_BUCKET}/openapi/oas/mms-v1/${sha}.json" "v1.json" |
| 173 | + - name: Generate YAML spec |
| 174 | + run: | |
| 175 | + sudo apt install yq |
| 176 | + yq -P '.' v1.json > v1.yaml |
| 177 | + - name: Upload artifact |
| 178 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 |
| 179 | + with: |
| 180 | + name: openapi-v1-${{ inputs.env }} |
| 181 | + path: | |
| 182 | + v1.json |
| 183 | + v1.yaml |
| 184 | + - name: Checkout repository |
| 185 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 186 | + with: |
| 187 | + ref: ${{ inputs.branch }} |
| 188 | + token: ${{secrets.api_bot_pat}} |
| 189 | + - name: Download artifact |
| 190 | + uses: actions/download-artifact@v4 |
| 191 | + with: |
| 192 | + name: openapi-v1-${{ inputs.env }} |
| 193 | + github-token: ${{ secrets.api_bot_pat }} |
| 194 | + run-id: ${{ github.run_id }} |
| 195 | + path: openapi/v1-deprecated |
| 196 | + - name: Commit changes |
| 197 | + id: commit |
| 198 | + uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 |
| 199 | + env: |
| 200 | + target_env: ${{ inputs.env }} |
| 201 | + target_branch: ${{ inputs.branch }} |
| 202 | + run_id: ${{ github.run_id }} |
| 203 | + with: |
| 204 | + commit_message: "(${{env.target_env}}) Release OpenAPI Spec V1 :rocket:. See https://github.com/mongodb/openapi/actions/runs/${{env.run_id}}." |
| 205 | + commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |
| 206 | + branch: ${{env.target_branch}} |
| 207 | + file_pattern: "openapi/v1-deprecated/*" |
| 208 | + |
156 | 209 | release-postman: |
157 | 210 | name: Release Postman |
158 | 211 | needs: [release] |
|
0 commit comments