Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Apr 12, 2024
1 parent 16db8ae commit a9dfc3b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 28 deletions.
21 changes: 0 additions & 21 deletions .bumpversion.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions .ci/scripts/create_release_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ then
exit 1
fi

NEW_BRANCH="$(bump2version --dry-run --list release | sed -Ene 's/^new_version=([[:digit:]]+\.[[:digit:]]+)\..*$/\1/p')"
NEW_BRANCH="$(bump-my-version show new_version --increment release | sed -Ene 's/^([[:digit:]]+\.[[:digit:]]+)\.[[:digit:]]+$/\1/p')"

if [[ -z "${NEW_BRANCH}" ]]
then
Expand All @@ -23,6 +23,6 @@ git branch "${NEW_BRANCH}"
# Clean changelog snippets.
find CHANGES/ \( -name "*.feature" -o -name "*.bugfix" -o -name "*.removal" -o -name "*.doc" -o -name "*.translation" -o -name "*.devel" -o -name "*.misc" \) -exec git rm -f \{\} +

bump2version minor --commit --message $'Bump version to {new_version}\n\n[noissue]' --allow-dirty
bump-my-version bump minor --commit --message $'Bump version to {new_version}\n\n[noissue]' --allow-dirty

git push origin "${NEW_BRANCH}"
6 changes: 3 additions & 3 deletions .ci/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ then
exit 1
fi

NEW_VERSION="$(bump2version --dry-run --list release | sed -ne 's/^new_version=//p')"
NEW_VERSION="$(bump-my-version show new_version --increment release)"
echo "Release ${NEW_VERSION}"

if ! [[ "${NEW_VERSION}" == "${BRANCH}"* ]]
Expand All @@ -20,7 +20,7 @@ then
fi

towncrier build --yes --version "${NEW_VERSION}"
bump2version release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty
bump2version patch --commit
bump-my-version bump release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty
bump-my-version bump patch --commit

git push origin "${BRANCH}" "${NEW_VERSION}"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install bump2version towncrier~=23.11.0
pip install bump-my-version~=0.20.0 towncrier~=23.11.0
- name: "Setup git"
run: |
git config user.name pulpbot
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
git config user.email [email protected]
- name: "Install python dependencies"
run: |
pip install bump2version
pip install bump-my-version~=0.20.0
- name: "Create Release Branch"
run: |
.ci/scripts/create_release_branch.sh
Expand Down
1 change: 1 addition & 0 deletions pulp-glue-gem/pulp_glue/gem/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.5.0.dev"
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ namespaces = true
"*" = ["py.typed", "locale/*/LC_MESSAGES/*.mo"]

[tool.pulp_cli_template]
# This section is co-managed by the cookiecutter templates.
# Changes to existing keys should be preserved.
app_label = "gem"
glue = true
docs = false
translations = false
main_package = "gem"

[tool.towncrier]
filename = "CHANGES.md"
Expand Down Expand Up @@ -127,3 +130,46 @@ module = [
"schema.*",
]
ignore_missing_imports = true

[tool.bumpversion]
# This section is managed by the cookiecutter templates.
current_version = "0.5.0.dev"
commit = false
tag = false
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.(?P<release>[a-z]+))?"
serialize = [
"{major}.{minor}.{patch}.{release}",
"{major}.{minor}.{patch}",
]

[tool.bumpversion.parts.release]
optional_value = "prod"
values = [
"dev",
"prod",
]

[[tool.bumpversion.files]]
filename = "./pulp-glue-gem/pulp_glue/gem/__init__.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "./pulpcore/cli/gem/__init__.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "./pulp-glue-gem/pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "./pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "./pyproject.toml"
search = "\"pulp-glue-gem=={current_version}\""
replace = "\"pulp-glue-gem=={new_version}\""

0 comments on commit a9dfc3b

Please sign in to comment.