Skip to content

Commit

Permalink
chore: add initial version of renovate config
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Feb 20, 2024
1 parent 8593d90 commit fb0e66f
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Renovate
jobs:
renovate:
container:
env:
LOG_LEVEL: debug
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions"]'
RENOVATE_GIT_AUTHOR: Renovate GitHub Bot <github@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
RENOVATE_REPOSITORY_CACHE: enabled
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
image: ghcr.io/renovatebot/renovate:37.202.2
options: '--user root'
outputs:
tokenExists: ${{ steps.check_token.outputs.tokenExists }}
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- run: env | sort
- run: |
if [ -z "${{ secrets.RENOVATE_TOKEN }}" ]; then
echo "RENOVATE_TOKEN not set, skipping ..."
else
renovate $RENOVATE_EXTRA_FLAG
fi
on:
push:
branches:
- xuan.hu/renovate
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 * * * 0,6'
workflow_dispatch: null
2 changes: 1 addition & 1 deletion .gitlab/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ci:
- '3.11'
- '3.12'
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- make dev
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ commitlint:
entrypoint: [""]
interruptible: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- |
Expand Down
3 changes: 2 additions & 1 deletion .gitlab/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dev-container-publish:
rules:
- changes:
- .devcontainer/Dockerfile
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "web"
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker context create builder
Expand Down
27 changes: 27 additions & 0 deletions .gitlab/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
renovate:
cache:
key: ${CI_COMMIT_REF_SLUG}-renovate
paths:
- renovate/cache/renovate/repository/
image: renovate/renovate:37.202.2
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- |
if [ -z "$RENOVATE_TOKEN" ]; then
echo "RENOVATE_TOKEN not set, skipping ..."
else
renovate $RENOVATE_EXTRA_FLAG
fi
stage: build
variables:
LOG_LEVEL: debug
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_BRANCH_PREFIX: renovate-gitlab/
RENOVATE_ENABLED_MANAGERS: '["pep621"]'
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_GIT_AUTHOR: Renovate GitLab Bot <gitlab@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: gitlab
RENOVATE_REPOSITORIES: '["$CI_PROJECT_PATH"]'
RENOVATE_REPOSITORY_CACHE: enabled
15 changes: 15 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices"
],
"ignorePaths": [
"**/template/**"
],
"lockFileMaintenance": {
"enabled": true,
"schedule": [
"at any time"
]
}
}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"maxdepth",
"modindex",
"mypy",
"ndjson",
"noninteractive",
"pathjoin",
"pipenv",
Expand All @@ -45,6 +46,7 @@
"pyproject",
"pytest",
"Quickstart",
"renovatebot",
"setuptools",
"softprops",
"sphinxcontrib",
Expand Down

0 comments on commit fb0e66f

Please sign in to comment.