-
Notifications
You must be signed in to change notification settings - Fork 26
INTPYTHON-406 Add automated release workflows for Django-MongoDB #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a35542f
INTPYTHON-406 Add automated release workflows for Django-MongoDB
blink1073 37bb07f
add version bump script
blink1073 65718c5
executable
blink1073 eec394e
switch to hatch
blink1073 e9cdd43
add requirements file
blink1073 47c23b2
BUMP 5.0.0.dev0
mongodb-dbx-release-bot[bot] 77aa3e3
BUMP 5.0.0.dev1
mongodb-dbx-release-bot[bot] 8b1f497
BUMP 5.0.0.dev2
mongodb-dbx-release-bot[bot] 51e7934
make following version optional
blink1073 c0ce2df
remove unused config
blink1073 86016df
switch to upstream
blink1073 0e092b8
address review
blink1073 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,8 @@ updates: | |
actions: | ||
patterns: | ||
- "*" | ||
# Python | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main", "*" ] | ||
pull_request: | ||
branches: [ "main", "*" ] | ||
schedule: | ||
- cron: '35 23 * * 5' | ||
workflow_call: | ||
inputs: | ||
ref: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
# required to fetch internal or private CodeQL packs | ||
packages: read | ||
actions: read | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: python | ||
build-mode: none | ||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
queries: security-extended | ||
config: | | ||
paths-ignore: | ||
- '.github/**' | ||
- 'tests/**' | ||
|
||
- shell: bash | ||
run: | | ||
pip install -e . | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:python" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Python Dist | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
required: true | ||
type: string | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies | ||
run: pip install build | ||
- name: Create packages | ||
run: python -m build . | ||
- name: Store package artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: all-dist-${{ github.run_id }} | ||
path: "dist/*" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The new version to set" | ||
required: true | ||
following_version: | ||
description: "The post (dev) version to set" | ||
required: false | ||
dry_run: | ||
description: "Dry Run?" | ||
default: false | ||
type: boolean | ||
|
||
env: | ||
# Changes per repo | ||
PRODUCT_NAME: django-mongodb | ||
# Changes per branch | ||
SILK_ASSET_GROUP: django-mongodb-main | ||
EVERGREEN_PROJECT: django-mongodb | ||
|
||
defaults: | ||
run: | ||
shell: bash -eux {0} | ||
|
||
jobs: | ||
pre-publish: | ||
environment: release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
outputs: | ||
version: ${{ steps.pre-publish.outputs.version }} | ||
steps: | ||
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2 | ||
with: | ||
app_id: ${{ vars.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
- uses: mongodb-labs/drivers-github-tools/setup@v2 | ||
with: | ||
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }} | ||
aws_region_name: ${{ vars.AWS_REGION_NAME }} | ||
aws_secret_id: ${{ secrets.AWS_SECRET_ID }} | ||
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }} | ||
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@v2 | ||
id: pre-publish | ||
with: | ||
version: ${{ inputs.version }} | ||
dry_run: ${{ inputs.dry_run }} | ||
|
||
build-dist: | ||
needs: [pre-publish] | ||
uses: ./.github/workflows/dist.yml | ||
with: | ||
ref: ${{ needs.pre-publish.outputs.version }} | ||
|
||
static-scan: | ||
needs: [pre-publish] | ||
uses: ./.github/workflows/codeql.yml | ||
with: | ||
ref: ${{ needs.pre-publish.outputs.version }} | ||
|
||
publish: | ||
needs: [build-dist, static-scan] | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
id-token: write | ||
contents: write | ||
attestations: write | ||
security-events: write | ||
steps: | ||
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2 | ||
with: | ||
app_id: ${{ vars.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
- uses: mongodb-labs/drivers-github-tools/setup@v2 | ||
with: | ||
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }} | ||
aws_region_name: ${{ vars.AWS_REGION_NAME }} | ||
aws_secret_id: ${{ secrets.AWS_SECRET_ID }} | ||
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }} | ||
- uses: mongodb-labs/drivers-github-tools/python/publish@v2 | ||
with: | ||
version: ${{ inputs.version }} | ||
following_version: ${{ inputs.following_version }} | ||
product_name: ${{ env.PRODUCT_NAME }} | ||
silk_asset_group: ${{ env.SILK_ASSET_GROUP }} | ||
evergreen_project: ${{ env.EVERGREEN_PROJECT }} | ||
token: ${{ github.token }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
dry_run: ${{ inputs.dry_run }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
django>=5.0,<5.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to note that this may need to change in our tagged 5.1 branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
pymongo>=4.6,<5.0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely want to revisit/cover what our semantic versioning strategy will be. We haven't really gone over it explicitly, but I agree with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devX
seems to be a convention but I'm not sure what it indicates … we are ondev2
now apparently 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was auto-incremented by the releaser, I'll switch back to 5.0a0