Skip to content

Commit

Permalink
feat: publiccode.yaml management by renovate (#2435)
Browse files Browse the repository at this point in the history
Attempt at renovate regexManager config for the publiccode.yaml file

Solves PZ-5082

---------

Co-authored-by: Cyril Roos <cyril@info.nl>
  • Loading branch information
niorg and Cyril Roos authored Jan 19, 2025
1 parent 49f8dee commit 1c40edc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 42 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -422,39 +422,6 @@ jobs:
makeLatest: true
generateReleaseNotes: true

update-publiccode-yml:
needs: [ next-version, create-release ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
env:
NEXT_VERSION: ${{ needs.next-version.outputs.version }}
steps:
# check out the repository with the private SSH key of the deploy key so that
# we can bypass the ruleset for the main branch
# see: https://github.com/sbellone/release-workflow-example for details
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ssh-key: ${{ secrets.DEPLOY_KEY_BYPASS_RULESET_MAIN_PRIVATE_KEY }}
- name: Get current date
id: set-current-date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- uses: elieahd/templater@f802bfce98073a045ad327cdc2c9857564fdfc07 # v1
with:
template: 'scripts/file-templates/publiccode-yaml-template.yaml'
file: 'publiccode.yaml'
variables: '
REPO_URL=${{ github.repositoryUrl }}
SOFTWARE_VERSION=${{ needs.next-version.outputs.version }}
REPO_CREATED_AT=${{ steps.set-current-date.outputs.date }}'
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add publiccode.yaml
git commit -m "${{ github.workflow }}" || echo "No changes to commit"
git push
trigger-provision:
needs: [next-version, push-docker-image]
env:
Expand Down
37 changes: 28 additions & 9 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
"hsiliev"
],
"prConcurrentLimit": 5,
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^publiccode.yaml$"],
"matchStrings": ["\\s+softwareVersion:(\\s)+(\\x22|\\x27)?(?<currentValue>.*?)(\\x22|\\x27)?\\s*releaseDate:(\\s)+(\\x22|\\x27)?(?:[^\\s]*?)(\\x22|\\x27)?"],
"depNameTemplate": "infonl/dimpact-zaakafhandelcomponent",
"datasourceTemplate": "github-tags",
"autoReplaceStringTemplate": "softwareVersion: {{{newValue}}}\nreleaseDate: {{{releaseTimestamp}}}"
}
],
"packageRules": [
{
"matchDatasources": [
Expand All @@ -32,7 +42,7 @@
{
"groupName": "Dependencies provided by WildFly",
"matchPackageNames": [
"jakarta.platform:jakarta.jakartaee-api",
"jakarta.platform:jakarta.jakartaee-api",
"org.eclipse.microprofile.config:microprofile-config-api",
"org.eclipse.microprofile.fault-tolerance:microprofile-fault-tolerance-api",
"org.eclipse.microprofile.health:microprofile-health-api",
Expand All @@ -45,7 +55,7 @@
"gradle"
],
"enabled": false,
"description": "Updates for dependencies that are provided by WildFly"
"description": ["Updates for dependencies that are provided by WildFly"]
},
{
"matchPackageNames": [
Expand All @@ -57,7 +67,7 @@
"gradle"
],
"allowedVersions": "<= 25.0.6",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -67,7 +77,7 @@
"docker"
],
"allowedVersions": "<= 2.4.4",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -77,7 +87,7 @@
"docker"
],
"allowedVersions": "<= 2.2.2",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -87,7 +97,7 @@
"docker"
],
"allowedVersions": "<= 2.3.0",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -97,7 +107,7 @@
"docker"
],
"allowedVersions": "<= 1.15.0",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -107,7 +117,7 @@
"docker"
],
"allowedVersions": "<= 1.7.1",
"description": "Pinned by the next Dimpact PodiumD release"
"description": ["Pinned by the next Dimpact PodiumD release"]
},
{
"matchPackageNames": [
Expand All @@ -122,7 +132,16 @@
"pinDigest"
],
"enabled": false,
"description": "The version of the ZAC Docker image in our Docker Compose file is set to 'latest' and is only used for local development"
"description": ["The version of the ZAC Docker image in our Docker Compose file is set to 'latest' and is only used for local development"]
},
{
"matchPackageNames": [
"zaakafhandelcomponent"
],
"matchDatasources": [
"custom"
],
"automerge": false,
}
]
}

0 comments on commit 1c40edc

Please sign in to comment.