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
39 changes: 39 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create GitHub release.

on:
workflow_dispatch:

jobs:
create-github-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.13

- name: Install dev requirements.
run: make requirements-dev

- name: Configure Git user.
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Read current version.
id: version
run: |
echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT

- name: Create and push Git tag.
env:
CURRENT_VERSION: ${{ steps.version.outputs.CURRENT_VERSION }}
run: |
git tag -am "Release $CURRENT_VERSION" "$CURRENT_VERSION"
git push origin "$CURRENT_VERSION"

- name: Create GitHub release.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scriv github-release --repo=Pearson-Advance/secure-cloudfront-video
65 changes: 65 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Create a release pull request.

on:
workflow_dispatch:
inputs:
semver-type:
description: "Semantic version to be released."
required: true
type: choice
options:
- "major"
- "minor"
- "patch"

jobs:
create-release-pr:
runs-on: ubuntu-latest
env:
SEMVER_TYPE: ${{ github.event.inputs.semver-type }}

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: 3.13

- name: Install dev requirements.
run: make requirements-dev

- name: Configure Git user.
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Calculate current and next version.
id: version
run: |
echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
echo "NEW_VERSION=$(bump-my-version show --increment $SEMVER_TYPE new_version)" >> $GITHUB_OUTPUT

- name: Execute bump version.
run: bump-my-version bump $SEMVER_TYPE

- name: Collect changelog entries.
run: make changelog-collect

- name: Create pull request.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURRENT_VERSION: ${{ steps.version.outputs.CURRENT_VERSION }}
NEW_VERSION: ${{ steps.version.outputs.NEW_VERSION }}
run: |
git checkout -b release-$NEW_VERSION
git commit -am "chore: bump version $CURRENT_VERSION → $NEW_VERSION"
git push origin release-$NEW_VERSION

gh pr create --base master \
--title "$NEW_VERSION release" \
--body "
## Description

This PR bumps the version from \`$CURRENT_VERSION\` to \`$NEW_VERSION\`.

The changelog has been automatically generated using \`scriv\`.
"
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Scriv starts here: https://scriv.readthedocs.io/en/latest/configuration.html#config-start-marker -->
scriv-end-here
## Version 2.0.0

## Description:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in

quality: clean ## check coding style with pycodestyle and pylint
pip install -r requirements/quality.txt
pycodestyle ./secure_cloudfront_video
pylint ./secure_cloudfront_video --rcfile=./setup.cfg

requirements-dev: ## install development environment requirements.
pip install -r requirements/dev.txt

changelog-entry: requirements-dev ## Create a new changelog entry.
scriv create --edit

changelog-collect: requirements-dev ## Collect changelog entries in the CHANGELOG.md file.
scriv collect
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!--

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file generated automatically? I ask because of its name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!, please check scriv library and the release process we are going to have from now on, this kind of file will be part of our regular PR process. I still need to create a new workflow to ensure these files are being added to each PR, but that's part of another PR. @anfbermudezme

Create a new changelog entry for every change in the repository.

Please adhere to the following instructions:
* Add a new bullet item for the category that best describes the change.
* You may optionally append "(by @<author>)" at the end of the bullet item,
where @<author> is the GitHub username of the author of the change. These
affiliations will be displayed in the release notes for every release.
* The accepted categories are: Removed, Added, Changed, Deprecated, Fixed,
and Security.
* Indicate breaking changes with a "**BREAKING CHANGE:**" prefix in the
bullet item.

Uncomment the section that is right (remove the HTML comment wrapper).
For top level release notes, leave all the headers commented out.
-->

### Removed

- Bumpversion has been removed from configuration files.


### Added

- Scriv support has been added to manage CHANGELOG files.
- changelog-entry and changelog commands have been added to Makefile.
- Bump-my-version has been added to improve the release process of the plugin.
- A new Github Action workflow has been added to create a PR for the release process.
- Pyproject.toml file has been added.
- A new Github Action workflow has been added to create a GH release and tag.
- New requirements dev.in & dev.txt files have been added to organize dev requirements.


<!--
### Changed

- A bullet item for the Changed category.

-->

<!--
### Deprecated

- A bullet item for the Deprecated category.

-->

<!--
### Fixed

- A bullet item for the Fixed category.

-->

<!--
### Security

- A bullet item for the Security category.

-->
4 changes: 4 additions & 0 deletions changelog.d/scriv.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[scriv]
version = literal: secure_cloudfront_video/__init__.py: __version__
format = md
new_fragment_template = file: changelog.d/scriv/new_fragment.${config:format}.j2
58 changes: 58 additions & 0 deletions changelog.d/scriv/new_fragment.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
Create a new changelog entry for every change in the repository.

Please adhere to the following instructions:
* Add a new bullet item for the category that best describes the change.
* You may optionally append "(by @<author>)" at the end of the bullet item,
where @<author> is the GitHub username of the author of the change. These
affiliations will be displayed in the release notes for every release.
* The accepted categories are: Removed, Added, Changed, Deprecated, Fixed,
and Security.
* Indicate breaking changes with a "**BREAKING CHANGE:**" prefix in the
bullet item.

Uncomment the section that is right (remove the HTML comment wrapper).
For top level release notes, leave all the headers commented out.
-->

<!--
### Removed

- A bullet item for the Removed category.

-->

<!--
### Added

- A bullet item for the Added category.

-->

<!--
### Changed

- A bullet item for the Changed category.

-->

<!--
### Deprecated

- A bullet item for the Deprecated category.

-->

<!--
### Fixed

- A bullet item for the Fixed category.

-->

<!--
### Security

- A bullet item for the Security category.

-->
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.bumpversion]
current_version = "3.0.0"
tag = false
commit = false

[[tool.bumpversion.files]]
filename = "secure_cloudfront_video/__init__.py"
4 changes: 4 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@

# Stay on the latest LTS release of Django
Django<6.0

# Development constraints.
bump-my-version==1.2.4
scriv==1.7.0
3 changes: 3 additions & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Development requirements used for CI and dev tooling.
bump-my-version
scriv
97 changes: 97 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# make upgrade
#
annotated-types==0.7.0
# via pydantic
anyio==4.11.0
# via httpx
attrs==25.4.0
# via scriv
bracex==2.6
# via wcmatch
bump-my-version==1.2.4
# via -r requirements/dev.in
certifi==2025.11.12
# via
# httpcore
# httpx
# requests
charset-normalizer==3.4.4
# via requests
click==8.2.1
# via
# bump-my-version
# click-log
# rich-click
# scriv
click-log==0.4.0
# via scriv
h11==0.16.0
# via httpcore
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via bump-my-version
idna==3.11
# via
# anyio
# httpx
# requests
jinja2==3.1.6
# via scriv
markdown-it-py==4.0.0
# via
# rich
# scriv
markupsafe==3.0.3
# via jinja2
mdurl==0.1.2
# via markdown-it-py
prompt-toolkit==3.0.52
# via questionary
pydantic==2.12.4
# via
# bump-my-version
# pydantic-settings
pydantic-core==2.41.5
# via pydantic
pydantic-settings==2.12.0
# via bump-my-version
pygments==2.19.2
# via rich
python-dotenv==1.2.1
# via pydantic-settings
questionary==2.1.1
# via bump-my-version
requests==2.32.5
# via scriv
rich==14.2.0
# via
# bump-my-version
# rich-click
rich-click==1.9.4
# via bump-my-version
scriv==1.7.0
# via -r requirements/dev.in
sniffio==1.3.1
# via anyio
tomlkit==0.13.3
# via bump-my-version
typing-extensions==4.15.0
# via
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.2
# via
# pydantic
# pydantic-settings
urllib3==2.5.0
# via requests
wcmatch==10.1
# via bump-my-version
wcwidth==0.2.14
# via prompt-toolkit
7 changes: 0 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[bumpversion]
current_version = 3.0.0
commit = True
tag = True

[pylint]
ignore = CVS

Expand Down Expand Up @@ -277,5 +272,3 @@ disable =
using-cmp-argument,
xrange-builtin,
zip-builtin-not-iterating,

[bumpversion:file:secure_cloudfront_video/__init__.py]