Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,61 @@ jobs:
path: packages/cli/dist
if-no-files-found: error

release-django-cf:
runs-on: ubuntu-latest
needs: release-cli
# django-cf depends on neither of the other packages, but every PSR job pushes
# a version bump to main, so the jobs are serialized to avoid racing on push.
if: always() && (needs.release-cli.result == 'success')
concurrency:
group: ${{ github.workflow }}-release-django-cf-${{ github.ref_name }}
cancel-in-progress: false

outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}

permissions:
contents: write

steps:
# Checkout latest ref (may include the preceding jobs' version commits)
- name: Setup | Checkout Repository on Release Branch
uses: actions/checkout@v4
with:
token: ${{ secrets.DEVPROD_PAT }}
ref: main
fetch-depth: 0

- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ secrets.DEVPROD_PAT }}
git_committer_name: "Workers DevProd"
git_committer_email: "workers-devprod@cloudflare.com"
directory: packages/django-cf

- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v10.5.3
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.DEVPROD_PAT }}
tag: ${{ steps.release.outputs.tag }}
directory: packages/django-cf

- name: Upload | Distribution Artifacts
uses: actions/upload-artifact@v4
if: steps.release.outputs.released == 'true'
with:
name: distribution-artifacts-django-cf
path: packages/django-cf/dist
if-no-files-found: error

deploy:
runs-on: ubuntu-latest
needs: [release-runtime-sdk, release-cli]
if: always() && (needs.release-runtime-sdk.outputs.released == 'true' || needs.release-cli.outputs.released == 'true')
needs: [release-runtime-sdk, release-cli, release-django-cf]
if: always() && (needs.release-runtime-sdk.outputs.released == 'true' || needs.release-cli.outputs.released == 'true' || needs.release-django-cf.outputs.released == 'true')

permissions:
contents: read
Expand Down
11 changes: 7 additions & 4 deletions packages/django-cf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# django-cf
# CHANGELOG

## 0.2.10
<!-- version list -->

### Patch Changes
## v0.2.10 and earlier

- [#47](https://github.com/G4brym/django-cf/pull/47) [`14b101a`](https://github.com/G4brym/django-cf/commit/14b101a5c1f01d6565f8cec222f3bdeabac50a98) Thanks [@G4brym](https://github.com/G4brym)! - Test changeset flow
Releases up to and including `0.2.10` were made from
[G4brym/django-cf](https://github.com/G4brym/django-cf) with Changesets. See that
repository for those entries. Everything from the next release onwards is generated by
python-semantic-release and inserted directly above this section.
3 changes: 1 addition & 2 deletions packages/django-cf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"scripts": {
"test": "uv run pytest",
"upgrade-templates": "cd templates/durable-objects && uv add django-cf --upgrade && cd ../d1 && uv add django-cf --upgrade",
"build": "rm -rf dist/ && python3 -m build",
"publish": "python3 -m twine upload dist/*"
"build": "rm -rf dist/ && uv build"
},
"devDependencies": {
"@changesets/changelog-github": "^0.6.0",
Expand Down
86 changes: 86 additions & 0 deletions packages/django-cf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,89 @@ exclude_lines = [
"raise NotImplementedError",
"if TYPE_CHECKING:",
]

[tool.semantic_release]
assets = []
build_command_env = []
commit_message = """\
Release django-cf {version}

Automatically generated by python-semantic-release
"""
commit_parser = "conventional-monorepo"
logging_use_named_masks = false
# django-cf is still on a 0.x version, unlike the two 1.x sibling packages, so a
# feat bumps the minor rather than forcing 1.0.0.
major_on_zero = false
allow_zero_version = true
no_git_verify = false
tag_format = "django-cf-v{version}"
version_toml = ["pyproject.toml:project.version"]
build_command = """
pip install uv
uv lock --upgrade-package "$PACKAGE_NAME"
git add uv.lock
uv build
"""

[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease_token = "rc"
prerelease = false

[tool.semantic_release.changelog]
exclude_commit_patterns = [
'''chore(?:\([^)]*?\))?: .+''',
'''ci(?:\([^)]*?\))?: .+''',
'''refactor(?:\([^)]*?\))?: .+''',
'''style(?:\([^)]*?\))?: .+''',
'''test(?:\([^)]*?\))?: .+''',
'''build\((?!deps\): .+)''',
'''Initial [Cc]ommit.*''',
]
mode = "update"
insertion_flag = "<!-- version list -->"

[tool.semantic_release.changelog.default_templates]
changelog_file = "CHANGELOG.md"
output_format = "md"
mask_initial_release = true

[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = false

[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "semantic-release <semantic-release>"

[tool.semantic_release.commit_parser_options]
path_filters = [".", "!tests/**", "!templates/**"]
scope_prefix = "django-cf"
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
other_allowed_tags = ["build", "chore", "ci", "docs", "style", "refactor", "test"]
allowed_tags = ["feat", "fix", "perf", "build", "chore", "ci", "docs", "style", "refactor", "test"]
default_bump_level = 0
parse_squash_commits = true
ignore_merge_commits = true

[tool.semantic_release.remote]
name = "origin"
type = "github"
ignore_token_for_push = false
insecure = false

[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true
9 changes: 0 additions & 9 deletions packages/django-cf/scripts/version.sh

This file was deleted.

Loading