|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: "The new version to set" |
| 8 | + required: true |
| 9 | + following_version: |
| 10 | + description: "The post (dev) version to set" |
| 11 | + required: false |
| 12 | + dry_run: |
| 13 | + description: "Dry Run?" |
| 14 | + default: false |
| 15 | + type: boolean |
| 16 | + |
| 17 | +env: |
| 18 | + # Changes per repo |
| 19 | + PRODUCT_NAME: django-mongodb |
| 20 | + # Changes per branch |
| 21 | + SILK_ASSET_GROUP: django-mongodb-main |
| 22 | + EVERGREEN_PROJECT: django-mongodb |
| 23 | + |
| 24 | +defaults: |
| 25 | + run: |
| 26 | + shell: bash -eux {0} |
| 27 | + |
| 28 | +jobs: |
| 29 | + pre-publish: |
| 30 | + environment: release |
| 31 | + runs-on: ubuntu-latest |
| 32 | + permissions: |
| 33 | + id-token: write |
| 34 | + contents: write |
| 35 | + outputs: |
| 36 | + version: ${{ steps.pre-publish.outputs.version }} |
| 37 | + steps: |
| 38 | + - uses: mongodb-labs/drivers-github-tools/secure-checkout@v2 |
| 39 | + with: |
| 40 | + app_id: ${{ vars.APP_ID }} |
| 41 | + private_key: ${{ secrets.APP_PRIVATE_KEY }} |
| 42 | + - uses: mongodb-labs/drivers-github-tools/setup@v2 |
| 43 | + with: |
| 44 | + aws_role_arn: ${{ secrets.AWS_ROLE_ARN }} |
| 45 | + aws_region_name: ${{ vars.AWS_REGION_NAME }} |
| 46 | + aws_secret_id: ${{ secrets.AWS_SECRET_ID }} |
| 47 | + artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }} |
| 48 | + - uses: mongodb-labs/drivers-github-tools/python/pre-publish@v2 |
| 49 | + id: pre-publish |
| 50 | + with: |
| 51 | + version: ${{ inputs.version }} |
| 52 | + dry_run: ${{ inputs.dry_run }} |
| 53 | + |
| 54 | + build-dist: |
| 55 | + needs: [pre-publish] |
| 56 | + uses: ./.github/workflows/dist.yml |
| 57 | + with: |
| 58 | + ref: ${{ needs.pre-publish.outputs.version }} |
| 59 | + |
| 60 | + static-scan: |
| 61 | + needs: [pre-publish] |
| 62 | + uses: ./.github/workflows/codeql.yml |
| 63 | + with: |
| 64 | + ref: ${{ needs.pre-publish.outputs.version }} |
| 65 | + |
| 66 | + publish: |
| 67 | + needs: [build-dist, static-scan] |
| 68 | + runs-on: ubuntu-latest |
| 69 | + environment: release |
| 70 | + permissions: |
| 71 | + id-token: write |
| 72 | + contents: write |
| 73 | + attestations: write |
| 74 | + security-events: write |
| 75 | + steps: |
| 76 | + - uses: mongodb-labs/drivers-github-tools/secure-checkout@v2 |
| 77 | + with: |
| 78 | + app_id: ${{ vars.APP_ID }} |
| 79 | + private_key: ${{ secrets.APP_PRIVATE_KEY }} |
| 80 | + - uses: mongodb-labs/drivers-github-tools/setup@v2 |
| 81 | + with: |
| 82 | + aws_role_arn: ${{ secrets.AWS_ROLE_ARN }} |
| 83 | + aws_region_name: ${{ vars.AWS_REGION_NAME }} |
| 84 | + aws_secret_id: ${{ secrets.AWS_SECRET_ID }} |
| 85 | + artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }} |
| 86 | + - uses: mongodb-labs/drivers-github-tools/python/publish@v2 |
| 87 | + with: |
| 88 | + version: ${{ inputs.version }} |
| 89 | + following_version: ${{ inputs.following_version }} |
| 90 | + product_name: ${{ env.PRODUCT_NAME }} |
| 91 | + silk_asset_group: ${{ env.SILK_ASSET_GROUP }} |
| 92 | + evergreen_project: ${{ env.EVERGREEN_PROJECT }} |
| 93 | + token: ${{ github.token }} |
| 94 | + repository_url: https://test.pypi.org/legacy/ |
| 95 | + dry_run: ${{ inputs.dry_run }} |
0 commit comments