Skip to content

Commit

Permalink
Merge pull request #12 from dafyddj/renovate/dafyddj-copier-bootstrap…
Browse files Browse the repository at this point in the history
…-2.x

chore(deps): update dependency dafyddj/copier-bootstrap to v2.0.10
  • Loading branch information
dafyddj authored May 23, 2024
2 parents 731a9d7 + 961092a commit b4aa895
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2.0.7
_commit: v2.0.10
_src_path: gh:dafyddj/copier-bootstrap
template_name: copier-packer-build
33 changes: 33 additions & 0 deletions .github/copier-renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"enabledManagers": [
"custom.regex",
],
"extends": [
":dependencyDashboard",
],
"allowedPostUpgradeCommands": [
"^git stash$",
"^copier update",
],
"branchPrefix": "copier-renovate/",
"requireConfig": "ignored",
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+) # __copier_update_available \\S+\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_pending (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
],
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_pending {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
"datasourceTemplate": "github-tags",
},
],
"postUpgradeTasks": {
"commands": [
"git stash",
"copier update --skip-answered --vcs-ref {{{newVersion}}}",
],
"executionMode": "update",
},
}
9 changes: 9 additions & 0 deletions .github/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

install-apt python3.8-venv pipx

runuser -u ubuntu pipx install copier

exec runuser -u ubuntu renovate
14 changes: 13 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_available (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_needed (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
],
"datasourceTemplate": "github-tags",
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_needed {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_available {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
},
],
"git-submodules": {
"enabled": true
},
"packageRules": [
{
"matchManagers": ["git-submodules"],
"automerge": true,
},
{
"matchManagers": ["custom.regex"],
"commitMessageSuffix": "available",
},
],
"platformAutomerge": false,
}
19 changes: 16 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,36 @@ concurrency:
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}

jobs:
should-run:
name: Should run
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
should-run: ${{ steps.action.outputs.should-run }}
steps:
- id: action
uses: techneg-it/should-workflow-run@dcbb88600d59ec2842778ef1e2d41f680f876329 # v1.0.0
pre-commit:
name: Run `pre-commit`
needs: should-run
if: fromJSON(needs.should-run.outputs.should-run)
runs-on: ubuntu-latest
env:
# renovate: datasource=github-releases depName=actions/python-versions extractVersion=^(?<version>\S+)-\d+$
PYTHON_VERSION: 3.12.3
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
test:
name: Run approval tests
needs: should-run
if: fromJSON(needs.should-run.outputs.should-run)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0 # `copier` prefers full-history clones
submodules: true
Expand All @@ -50,7 +63,7 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: codfish/semantic-release-action@b0e57c976bf8f74b2454f59a30e4a1b5f11727b4 # v3.3.0
with:
plugins: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Self-hosted Renovate

on:
workflow_dispatch:

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/create-github-app-token@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1.10.0
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Self-hosted Renovate
uses: renovatebot/github-action@063e0c946b9c1af35ef3450efc44114925d6e8e6 # v40.1.11
with:
configurationFile: .github/copier-renovate.json5
docker-cmd-file: .github/entrypoint.sh
docker-user: root
token: ${{ steps.app-token.outputs.token }}
env:
LOG_LEVEL: debug
RENOVATE_DRY_RUN: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}
RENOVATE_REPOSITORIES: ${{ github.repository }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
args: [--assume-in-merge]
- id: check-yaml
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.3
rev: 0.28.4
hooks:
- id: check-github-workflows
name: Check GitHub workflows with check-jsonschema
Expand Down
33 changes: 33 additions & 0 deletions template/.github/copier-renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"enabledManagers": [
"custom.regex",
],
"extends": [
":dependencyDashboard",
],
"allowedPostUpgradeCommands": [
"^git stash$",
"^copier update",
],
"branchPrefix": "copier-renovate/",
"requireConfig": "ignored",
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+) # __copier_update_available \\S+\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_pending (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
],
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_pending {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
"datasourceTemplate": "github-tags",
},
],
"postUpgradeTasks": {
"commands": [
"git stash",
"copier update --skip-answered --vcs-ref {{{newVersion}}}",
],
"executionMode": "update",
},
}
9 changes: 9 additions & 0 deletions template/.github/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

install-apt python3.8-venv pipx

runuser -u ubuntu pipx install copier

exec runuser -u ubuntu renovate
14 changes: 13 additions & 1 deletion template/.github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_available (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: (?<currentDigest>\\S+) # __copier_update_needed (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
],
"datasourceTemplate": "github-tags",
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_needed {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
"autoReplaceStringTemplate": "_commit: {{#if currentDigest}}{{{currentDigest}}}{{else}}{{{currentValue}}}{{/if}} # __copier_update_available {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
},
],
"git-submodules": {
"enabled": true
},
"packageRules": [
{
"matchManagers": ["git-submodules"],
"automerge": true,
},
{
"matchManagers": ["custom.regex"],
"commitMessageSuffix": "available",
},
],
"platformAutomerge": false,
}
27 changes: 27 additions & 0 deletions template/.github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Self-hosted Renovate

on:
workflow_dispatch:

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/create-github-app-token@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1.10.0
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Self-hosted Renovate
uses: renovatebot/github-action@063e0c946b9c1af35ef3450efc44114925d6e8e6 # v40.1.11
with:
configurationFile: .github/copier-renovate.json5
docker-cmd-file: .github/entrypoint.sh
docker-user: root
token: ${{ steps.app-token.outputs.token }}
env:
LOG_LEVEL: debug
RENOVATE_DRY_RUN: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}
RENOVATE_REPOSITORIES: ${{ github.repository }}
3 changes: 3 additions & 0 deletions test/GenerateProject/catalogue.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ The following new files/directories were created:
<Test Directory>
----.copier-answers.yml
----.github
--------copier-renovate.json5
--------entrypoint.sh
--------renovate.json5
--------workflows
------------libbuild.yml
------------renovate.yml
----.gitignore
----.pre-commit-config.yaml
----bin
Expand Down
3 changes: 3 additions & 0 deletions test/SetBoxName/catalogue.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ The following new files/directories were created:
<Test Directory>
----.copier-answers.yml
----.github
--------copier-renovate.json5
--------entrypoint.sh
--------renovate.json5
--------workflows
------------libbuild.yml
------------renovate.yml
----.gitignore
----.pre-commit-config.yaml
----bin
Expand Down

0 comments on commit b4aa895

Please sign in to comment.