Adapt for Solr

This commit is contained in:
Jan Høydahl 2023-02-17 01:32:26 +01:00
parent 76c99fbefe
commit 15c48d9217
7 changed files with 47 additions and 190 deletions

41
.github/renovate.json vendored
View file

@ -1,41 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>renovatebot/.github", ":pinDependencies"],
"packageRules": [
{
"description": "Automerge Renovate updates",
"semanticCommitType": "fix",
"matchPackageNames": ["renovate/renovate"],
"matchUpdateTypes": ["major", "minor", "patch"]
},
{
"description": "Update references in markdown files weekly",
"matchPaths": ["**/*.md"],
"extends": ["schedule:weekly"],
"automerge": true,
"stabilityDays": 0,
"separateMajorMinor": false,
"commitMessageTopic": "references to {{{depName}}}",
"semanticCommitType": "docs",
"semanticCommitScope": null,
"additionalBranchPrefix": "docs-"
}
],
"regexManagers": [
{
"fileMatch": ["^src/docker\\.ts$"],
"matchStrings": [
"// renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+const\\s+tag\\s+=\\s+'(?<currentValue>.+?)';"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
{
"fileMatch": ["^README\\.md$"],
"matchStrings": [
"uses: renovatebot/github-action@(?<currentValue>[^\\s]+)"
],
"depNameTemplate": "renovatebot/github-action",
"datasourceTemplate": "github-releases"
}
]
}

View file

@ -1,143 +0,0 @@
name: Build
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
commitlint:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Lint commit messages
uses: wagoid/commitlint-github-action@09faa1aae81627890cbffff1d0f7bc0e520a8b01 # v5.3.1
continue-on-error: true
lint:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: '16.x'
cache: 'yarn'
- name: Install project
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
e2e:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
strategy:
fail-fast: false
matrix:
configurationFile: [example/renovate-config.js, example/renovate.json]
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Install project
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Configure renovate token
run: |
if [[ "${RENOVATE_TOKEN}" != "" ]]; then
echo "RENOVATE_TOKEN=${RENOVATE_TOKEN}" >> $GITHUB_ENV
else
echo "RENOVATE_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
- name: Renovate test
uses: ./
env:
LOG_LEVEL: debug
with:
configurationFile: ${{ matrix.configurationFile }}
build:
needs: [lint, commitlint, e2e]
runs-on: ubuntu-latest
steps:
- run: echo 'dummy'
release:
needs: [build]
runs-on: ubuntu-latest
if: |
(
startsWith(github.event.commits[0].message, 'fix(deps): update renovate/renovate docker tag ')
|| startsWith(github.event.commits[0].message, 'fix(deps): update dependency renovate/renovate ')
|| github.event_name == 'workflow_dispatch'
)
&& github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
ref: 'release'
- name: Fetch tags
run: git fetch --tags
- name: Setup Git user
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Merge main
run: |
git merge -m 'chore(release): merge main (${{ github.sha }})' ${{ github.sha }}
- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: '16.x'
- name: Install project
run: yarn install --frozen-lockfile --ignore-scripts
- name: Get version
id: release
run: yarn release:version
- name: Release
run: yarn release -- "${{ steps.release.outputs.version }}"
- name: Get changelog section
id: changelog
run: |
changelog="$(git show --unified=0 CHANGELOG.md \
| tail +12 \
| sed -e 's/^\+//' \
| sed -z 's/\n/%0A/g;s/\r/%0D/g')"
echo "::set-output name=changelog::${changelog}"
- name: Publish release
run: git push --follow-tags
- name: Publish GitHub release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # renovate: tag=v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.release.outputs.version }}
release_name: v${{ steps.release.outputs.version }}
body: |
*See the the [changelog](
https://github.com/${{ github.repository }}/blob/release/CHANGELOG.md
) for changes in all releases.*
${{ steps.changelog.outputs.changelog }}

19
.github/workflows/renovate.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Renovate
on:
schedule:
# The "*" (#42, asterisk) character has special semantics in YAML, so this
# string has to be quoted.
- cron: '0/5 * * * *'
jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
- name: Self-hosted Renovate
uses: renovatebot/github-action@v34.82.0
with:
configurationFile: solr/renovate-config.js
token: ${{ secrets.RENOVATE_TOKEN }}
env:
RENOVATE_FORK_TOKEN: ${{ secrets.RENOVATE_TOKEN }}

4
.gitignore vendored
View file

@ -1,3 +1,5 @@
.idea
##################################################### #####################################################
# macOS # # macOS #
# Source: https://www.gitignore.io # # Source: https://www.gitignore.io #
@ -187,7 +189,7 @@ typings/
# nuxt.js build output # nuxt.js build output
.nuxt .nuxt
# react / gatsby # react / gatsby
public/ public/
# vuepress build output # vuepress build output

View file

@ -1,3 +1,5 @@
# Changelog # Changelog
The changelog is only available on the `releases` branch. Please refer to [CHANGELOG.md](https://github.com/renovatebot/github-action/blob/releases/CHANGELOG.md) there. ## v0.1
* First attempt

View file

@ -1,6 +1,11 @@
# GitHub Action Renovate # Renovate Github Action for Apache Solr
GitHub Action to run Renovate self-hosted. GitHub Action to run Renovate self-hosted for the Apache Solr
This action configuration is forked from https://github.com/renovatebot/github-action.
See `.github/workflows/renovate.yml` for the workflow and `solr/` folder for custom config.
Below are the original instructions from the forked project.
<a name="toc"></a> <a name="toc"></a>
@ -31,7 +36,7 @@ Options can be passed using the inputs of this action or the corresponding envir
## `configurationFile` ## `configurationFile`
Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./example) directory. Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./solr) directory.
The configurations that can be done in this file consists of two parts, as listed below. Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options. The configurations that can be done in this file consists of two parts, as listed below. Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options.
@ -57,7 +62,7 @@ If you want to use the `github-actions` manager, you must setup a [special token
## Example ## Example
This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/renovate-config.js`](./example/renovate-config.js) file as configuration. This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/renovate-config.js`](solr/renovate-config.js) file as configuration.
You can also see a live example of this action in my [github-renovate](https://github.com/vidavidorra/github-renovate) repository, which also includes a more [advanced configuration](https://github.com/vidavidorra/github-renovate/blob/master/src/renovate-config.ts) for updating GitHub Action workflows. You can also see a live example of this action in my [github-renovate](https://github.com/vidavidorra/github-renovate) repository, which also includes a more [advanced configuration](https://github.com/vidavidorra/github-renovate/blob/master/src/renovate-config.ts) for updating GitHub Action workflows.
**Remark** Update the action version to the most current, see [here](https://github.com/renovatebot/github-action/releases/latest) for latest release. **Remark** Update the action version to the most current, see [here](https://github.com/renovatebot/github-action/releases/latest) for latest release.

13
solr/renovate-config.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
branchPrefix: 'renovate/',
gitAuthor: 'SolrBot <solrbot@cominvent.com>',
onboarding: false,
requireConfig: false,
platform: 'github',
includeForks: false,
repositories: [
'cominvent/renovate-test'
],
allowedPostUpgradeCommands: ["./gradlew.*"],
dryRun: "full"
};