diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml deleted file mode 100644 index 5707747f..00000000 --- a/.github/workflows/update-sdk.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Update SDK - -on: - schedule: - - cron: "0 14 * * 2" - workflow_dispatch: - -jobs: - update-sdk: - name: Update SDK if Necessary - runs-on: ubuntu-latest - outputs: - generate: ${{ steps.compare.outputs.generate }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Combine Product Specs - uses: Bandwidth/api-specs-combine-action@v1.0.0 - with: - token: ${{ secrets.DX_GITHUB_TOKEN }} - - - name: Determine if a New SDK is Needed - id: compare - run: | - if cmp -s "bandwidth.yml" "api-specs/bandwidth.yml"; then :; else mv -f api-specs/bandwidth.yml bandwidth.yml; rm -r -f api-specs; echo "generate=true" >> $GITHUB_OUTPUT; fi - - - name: Create JIRA Card for SDK Update - if: ${{ steps.compare.outputs.generate == 'true' }} - id: jira - run: | - JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \ - -X POST https://bandwidth-jira.atlassian.net/rest/api/2/issue \ - -H "Content-Type: application/json" \ - --data-binary @- << EOF - { - "fields": { - "project": { - "key": "SWI" - }, - "summary": "[$LANGUAGE] Update SDK for New Spec Version", - "description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.", - "issuetype": { - "name": "Story" - }, - "customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.", - "customfield_10205": "$EPIC", - "components": [{ - "name": "Client SDKs" - }] - } - } - EOF - )) - echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT - env: - LANGUAGE: Ruby - EPIC: SWI-1876 - JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }} - JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} - - - name: Build SDK - id: build - if: ${{ startsWith(steps.jira.outputs.jira-key, 'SWI') }} - uses: Bandwidth/generate-sdk-action@v3.0.0 - with: - branch-name: ${{ steps.jira.outputs.jira-key }} - token: ${{ secrets.DX_GITHUB_TOKEN }} - openapi-generator-version: 7.0.0 - language: ruby - config: ./openapi-config.yml - - - name: Setup Ruby - if: steps.build.outputs.changes - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.0" - - - name: Clean SDK - if: steps.build.outputs.changes - run: | - bundle install - rubocop -A - git add . - git commit -m "Clean SDK using Rubocop" - git push origin ${{ steps.jira.outputs.jira-key }} - - - name: Open Pull Request - if: steps.build.outputs.changes - run: | - gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow' - env: - GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }} - - notify-for-failures: - name: Notify for Failures - needs: [update-sdk] - if: failure() - runs-on: ubuntu-latest - steps: - - name: Notify Slack of Failures - uses: Bandwidth/build-notify-slack-action@v1.0.0 - with: - job-status: failure - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} - slack-channel: ${{ secrets.SLACK_CHANNEL }}