APIBot: SDK update based on recent changes in Atlas API (#683) #113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Autorelease | |
| on: | |
| workflow_dispatch: {} # workflow can be run manually | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "internal/core/version.go" | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_tag: ${{ steps.set_tag.outputs.release_tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| - name: Release env | |
| id: set_tag | |
| working-directory: ./tools | |
| run: ./releaser/scripts/setghenv.sh | |
| - name: Create Release | |
| uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 | |
| with: | |
| body: ${{ env.RELEASE_NOTES }} | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| name: ${{ env.RELEASE_TAG }} | |
| - name: Trigger Go proxy cache refresh | |
| run: | | |
| LATEST_SDK_TAG=$(curl -sSfL https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name') | |
| LATEST_SDK_RELEASE=$(echo "${LATEST_SDK_TAG}" | cut -d '.' -f 1) | |
| echo "tag: ${LATEST_SDK_TAG}, release: ${LATEST_SDK_RELEASE}" | |
| curl -sSfL "https://proxy.golang.org/go.mongodb.org/atlas-sdk/${LATEST_SDK_RELEASE}/@v/${LATEST_SDK_TAG}.info" | |
| compliance: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| env: | |
| SILKBOMB_IMG: ${{ vars.SILKBOMB_IMG }} | |
| RELEASE_TAG: ${{ needs.release.outputs.release_tag }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| with: | |
| ref: ${{ env.RELEASE_TAG }} | |
| - name: Generate PURLs and SBOM | |
| run: make gen-purls gen-sbom | |
| - name: Upload SBOM to Kondukto | |
| run: make upload-sbom | |
| env: | |
| KONDUKTO_TOKEN: ${{ secrets.KONDUKTO_TOKEN }} | |
| KONDUKTO_REPO: ${{ vars.KONDUKTO_REPO }} | |
| KONDUKTO_BRANCH_PREFIX: ${{ vars.KONDUKTO_BRANCH_PREFIX }} | |
| - name: Upload SBOM as release artifact | |
| uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 | |
| with: | |
| files: compliance/sbom.json | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| generate-ssdlc-report: | |
| needs: compliance | |
| runs-on: ubuntu-latest | |
| env: | |
| RELEASE_TAG: ${{ needs.release.outputs.release_tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| - uses: mongodb/terraform-provider-mongodbatlas/.github/templates/run-script-and-commit@master | |
| with: | |
| script_call: | | |
| TAG="${{ env.RELEASE_TAG }}" | |
| VERSION="${TAG#v}" | |
| AUTHOR="${{ github.actor }}" | |
| export AUTHOR VERSION | |
| ./scripts/compliance/gen-ssdlc-report.sh | |
| file_to_commit: "compliance/v*/ssdlc-compliance-*.md" | |
| commit_message: "chore: Update SSDLC report for ${{ env.RELEASE_TAG }}" | |
| apix_bot_pat: ${{ secrets.APIX_BOT_PAT }} | |
| remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} | |
| gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} |