Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-fra committed Aug 20, 2024
0 parents commit 1d41a21
Show file tree
Hide file tree
Showing 33 changed files with 8,762 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
groups:
github-actions:
patterns:
- "actions/*"
# Keep maven-dependencies up to date
- package-ecosystem: "maven"
directory: /
schedule:
interval: "daily"
groups:
maven-plugins:
patterns:
- "org.apache.maven.plugins:*"
- "org.codehaus.mojo:*"
34 changes: 34 additions & 0 deletions .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot Automation
on: pull_request

permissions:
contents: write
pull-requests: write
issues: write
repository-projects: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot Metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Label Major Updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-major'}}
run: |
gh label create "major-update" --color "B60205" --description "Major Dependency Update" --repo "$REPO" || true
gh pr edit "$PR_URL" --add-label "major-update"
env:
REPO: ${{github.repository}}
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable Auto-Merge for Patch Updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
91 changes: 91 additions & 0 deletions .github/workflows/maven-build-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build, Test & Publish

on:
push:
branches:
- "main"
- "maintenance/*"
tags:
- "v*"

jobs:
version:
name: Determine Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 2
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Detect Version
id: version
run: ./mvnw -B -q -N exec:exec -Dexec.executable=echo -Dexec.args='version=${project.version}' >>"$GITHUB_OUTPUT"

build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Compile & Test
run: ./mvnw -V -B --no-transfer-progress
clean package verify
-Psonarcloud
-Dsonar.projectKey=io.redlink.solr:solr-advanced-suggester
-Dsonar.skip=${{ github.actor == 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/TEST-*.xml'

deploy:
name: Publish
needs:
- version
- build
runs-on: ubuntu-latest
if: github.repository == 'redlink-gmbh/solr-advanced-suggester'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish Packages
run: ./mvnw -B --no-transfer-progress
deploy
-Prelease
-Dquick
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
43 changes: 43 additions & 0 deletions .github/workflows/maven-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build & Test

on:
push:
branches-ignore:
- "main"
- "maintenance/v*"
pull_request:
types: [ opened, synchronize, reopened ]

permissions:
checks: write
pull-requests: write

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java/Maven
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Compile & Test
run: ./mvnw -V -B --no-transfer-progress
clean package verify
-Psonarcloud
-Dsonar.projectKey=io.redlink.solr:solr-advanced-suggester
-Dsonar.skip=${{ github.actor == 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/TEST-*.xml'
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
*.tmp
*.bak

.idea/
*.iws
*.iml
.idea_modules/

target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

.metadata
*.swp
*~.nib
local.properties
.settings/
.recommenders
.project
.externalToolBuilders/
*.launch
.classpath
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Loading

0 comments on commit 1d41a21

Please sign in to comment.