Skip to content

feat(no-release): use copier manager in Renovate #882

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ jobs:
container:
env:
LOG_LEVEL: debug
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git", "^pdm", "^pip", "^copier", "^find"]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^find", "^pdm"]'
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED: ${{ vars.RENOVATE_ENABLED || true }}
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "gitlabci", "regex", "pre-commit"]'
RENOVATE_ENABLED_MANAGERS: '["copier", "github-actions", "gitlabci", "pep621", "pre-commit", "regex"]'
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ renovate:
variables:
GIT_STRATEGY: none
LOG_LEVEL: debug
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git", "^pdm", "^pip", "^copier", "^find"]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^find", "^pdm"]'
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_BRANCH_PREFIX: renovate-gitlab/
RENOVATE_ENABLED_MANAGERS: '["pep621", "gitlabci", "regex", "pre-commit"]'
RENOVATE_ENABLED_MANAGERS: '["copier", "gitlabci", "pep621", "pre-commit", "regex"]'
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: gitlab
Expand Down
43 changes: 14 additions & 29 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"constraints": {
"copier": "9.4.1",
"pdm": "2.22.3",
"python": "==3.12"
},
Expand Down Expand Up @@ -59,6 +60,19 @@
"uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?<currentValue>.*)\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "pypi",
"depNameTemplate": "copier",
"description": "Match copier version specified in the renovate constraints",
"fileMatch": [
"^\\.renovaterc\\.json$",
"^template/\\.renovaterc\\.json\\.jinja$"
],
"matchStrings": [
"\"copier\": \"(?<currentValue>.*)\""
]
},
{
"customType": "regex",
"datasourceTemplate": "pypi",
Expand Down Expand Up @@ -100,20 +114,6 @@
"--package (?<depName>.+?)@(?<currentValue>.+?)\\s"
],
"versioningTemplate": "docker"
},
{
"customType": "regex",
"datasourceTemplate": "git-tags",
"depNameTemplate": "https://github.com/serious-scaffold/ss-python.git",
"depTypeTemplate": "copier-template",
"description": "Match template version specified in .copier-answers.yml",
"fileMatch": [
"^\\.copier-answers\\.yml$"
],
"matchStrings": [
"_commit: (?<currentValue>.*?)\n"
],
"versioningTemplate": "semver"
}
],
"extends": [
Expand Down Expand Up @@ -200,21 +200,6 @@
]
}
},
{
"commitMessageTopic": "serious-scaffold-python",
"description": "Update template with copier when a new version is released",
"matchDepTypes": [
"copier-template"
],
"postUpgradeTasks": {
"commands": [
"git stash",
"pip install copier==9.4.1",
"copier update --defaults --vcs-ref {{{newVersion}}}"
]
},
"semanticCommitScope": "copier-template"
},
{
"description": "Group pdm Python package and version specified in setup-pdm GitHub Action",
"groupName": "pdm",
Expand Down
45 changes: 16 additions & 29 deletions template/.renovaterc.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"constraints": {
"copier": "9.4.1",
"pdm": "2.22.3",
"python": "=={{ default_py }}"
},
Expand Down Expand Up @@ -66,6 +67,21 @@
"uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?<currentValue>.*)\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "pypi",
"depNameTemplate": "copier",
"description": "Match copier version specified in the renovate constraints",
"fileMatch": [
"^\\.renovaterc\\.json$"
[%- if project_name == "Serious Scaffold Python" %],
"^template/\\.renovaterc\\.json\\.jinja$"
[% endif %]
],
"matchStrings": [
"\"copier\": \"(?<currentValue>.*)\""
]
},
{
"customType": "regex",
"datasourceTemplate": "pypi",
Expand Down Expand Up @@ -111,20 +127,6 @@
"--package (?<depName>.+?)@(?<currentValue>.+?)\\s"
],
"versioningTemplate": "docker"
},
{
"customType": "regex",
"datasourceTemplate": "git-tags",
"depNameTemplate": "https://github.com/serious-scaffold/ss-python.git",
"depTypeTemplate": "copier-template",
"description": "Match template version specified in .copier-answers.yml",
"fileMatch": [
"^\\.copier-answers\\.yml$"
],
"matchStrings": [
"_commit: (?<currentValue>.*?)\n"
],
"versioningTemplate": "semver"
}
],
"extends": [
Expand Down Expand Up @@ -215,21 +217,6 @@
]
}
},
{
"commitMessageTopic": "serious-scaffold-python",
"description": "Update template with copier when a new version is released",
"matchDepTypes": [
"copier-template"
],
"postUpgradeTasks": {
"commands": [
"git stash",
"pip install copier==9.4.1",
"copier update --defaults --vcs-ref {{ '{{{newVersion}}}' }}"
]
},
"semanticCommitScope": "copier-template"
},
{
"description": "Group pdm Python package and version specified in setup-pdm GitHub Action",
"groupName": "pdm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jobs:
container:
env:
LOG_LEVEL: debug
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git", "^pdm", "^pip", "^copier", "^find"]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^find", "^pdm"]'
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED: {{ '${{ vars.RENOVATE_ENABLED || true }}' }}
[% if project_name == "Serious Scaffold Python" %]
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "gitlabci", "regex", "pre-commit"]'
RENOVATE_ENABLED_MANAGERS: '["copier", "github-actions", "gitlabci", "pep621", "pre-commit", "regex"]'
[% else %]
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "regex", "pre-commit"]'
RENOVATE_ENABLED_MANAGERS: '["copier", "github-actions", "pep621", "pre-commit", "regex"]'
[% endif %]
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: github
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ renovate:
variables:
GIT_STRATEGY: none
LOG_LEVEL: debug
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git", "^pdm", "^pip", "^copier", "^find"]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^find", "^pdm"]'
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_BRANCH_PREFIX: renovate-gitlab/
RENOVATE_ENABLED_MANAGERS: '["pep621", "gitlabci", "regex", "pre-commit"]'
RENOVATE_ENABLED_MANAGERS: '["copier", "gitlabci", "pep621", "pre-commit", "regex"]'
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: gitlab
Expand Down
Loading