Merge pull request #12 from redlink-gmbh/dependabot/github_actions/ac… #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Test & Publish | |
on: | |
push: | |
branches: | |
- "master" | |
- "maintenance/*" | |
tags: | |
- "v*" | |
jobs: | |
version: | |
name: Determine Version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/[email protected] | |
name: Checkout | |
with: | |
fetch-depth: 2 | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- name: Detect Version | |
id: version | |
run: VERSION=$(mvn -B -q -N exec:exec -Dexec.executable=echo -Dexec.args='${project.version}') | |
echo "::set-output name=version::${VERSION}" | |
build-and-test: | |
name: Build and Test (Solr ${{matrix.solr}} / Java${{ matrix.java }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ 11, 8 ] | |
solr: [ 8.11.1, 7.7.3, 6.6.6 ] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
cache: maven | |
- name: Compile & Test | |
env: | |
SOLR_VERSION: ${{ matrix.solr }} | |
run: mvn -V -B --no-transfer-progress | |
clean package verify | |
-Prelease | |
-Dgpg.skip | |
-Dsolr.version=${SOLR_VERSION} | |
- name: Upload Test-Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Results (${{matrix.solr}} - Java${{ matrix.java }}) | |
path: '**/TEST-*.xml' | |
publish-test-results: | |
name: Publish Test Results | |
needs: [ build-and-test ] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Fetch Test-Results | |
uses: actions/download-artifact@v3 | |
with: | |
path: test-results | |
- name: Publish Test-Results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
with: | |
files: 'test-results/**/TEST-*.xml' | |
deploy: | |
name: Publish | |
needs: | |
- version | |
- build-and-test | |
runs-on: ubuntu-latest | |
if: github.repository == 'redlink-gmbh/solr-compound-word-filter' | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
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: mvn -B --no-transfer-progress | |
package deploy | |
-Prelease | |
-Dquick | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |