Skip to content

Merge pull request #377 from senacor/dependabot/maven/org.openrewrite… #1375

Merge pull request #377 from senacor/dependabot/maven/org.openrewrite…

Merge pull request #377 from senacor/dependabot/maven/org.openrewrite… #1375

Workflow file for this run

name: Maven Matrix Build
on:
push:
branches:
- master
- release
paths-ignore:
- '*.md'
# pull_request to run the pipeline on PRs from external, because "push" does not create this pipeline on external PRs
pull_request:
paths-ignore:
- '*.md'
schedule:
# * is a special character in YAML, so you have to quote this string
- cron: '11 16 * * 4'
env:
MVN_CMD: "./mvnw --settings .cicd.settings.xml -e -B -V"
GPG_EXECUTABLE: gpg
jobs:
build-with-jdk:
strategy:
matrix:
java: [ 17, 21 ]
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
- name: Build and test with Maven
run: $MVN_CMD install
build-with-es:
strategy:
matrix:
elasticsearchVersion: [ "8.13.4", "8.12.2", "8.11.4", "8.10.4", "8.9.2", "8.8.2", "8.7.1", "8.6.2", "8.5.3", "8.4.3", "8.3.3", "8.2.3", "8.1.3", "8.0.1",
"7.17.21", "7.5.2" ]
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Build and test with Maven
run: $MVN_CMD install -DskipTests
- name: elasticsearch test version ${{ matrix.elasticsearchVersion }}
run: $MVN_CMD --file ./tests/pom.xml clean verify -Delasticsearch.version=${{ matrix.elasticsearchVersion }}
## on github actions Linux containers (LCOW) are not supported:
## https://stackoverflow.com/questions/66077884/testcontainers-in-windows-environment-on-github-actions-could-not-find-a-valid
## https://github.com/actions/runner-images/issues/252
## https://github.com/actions/runner-images/issues/2216
# build-with-windows:
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up JDK 8
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# ja# - name: Set up Docker
# uses: crazy-max/ghaction-setup-docker@v1
# with:
# version: 23.0.1va-version: 8
# - name: Build and test with Maven
# run: .\mvnw.cmd --settings .cicd.settings.xml -e -B -V install
# macos builds are very flaky :/
# build-with-macos:
# runs-on: macos-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up JDK 8
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# java-version: 8
# - name: Install Docker
# # docker is not installed by default https://github.com/actions/runner-images/issues/17
# uses: docker-practice/actions-setup-docker@master
# timeout-minutes: 12
# - name: Build and test with Maven
# run: $MVN_CMD install
release-dry-run:
# this will just build like the real release job, but not do a release (dry run)
if: ${{ github.ref != 'refs/heads/release' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Import GPG key to sign maven build artifacts
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_SECRET_KEYS }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Set up JDK 17
# with JDK 11 the maven-javadoc-plugin > 3.0.1 fails with "cannot find symbol org.elasticsearch.*"
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Release to maven central
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: $MVN_CMD deploy -DskipTests=true -Drelease -Dmaven.deploy.skip=true -DskipNexusStagingDeployMojo=true
- name: prepare release version
run: source prepare_release_version.sh
release:
# Release to maven central and create Github release
needs: [ build-with-jdk, build-with-es ]
if: ${{ github.repository == 'senacor/elasticsearch-evolution' && github.event_name == 'push' && github.ref == 'refs/heads/release' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Import GPG key to sign maven build artifacts
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_SECRET_KEYS }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Set up JDK 17
# with JDK 11 the maven-javadoc-plugin > 3.0.1 fails with "cannot find symbol org.elasticsearch.*"
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Release to maven central
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: $MVN_CMD deploy -DskipTests=true -Drelease
- name: prepare release version
run: source prepare_release_version.sh
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.TRAVIS_TAG }}
release_name: ${{ env.PROJECT_VERSION }}
body: ""
draft: false
prerelease: ${{ env.IS_SNAPSHOT }}
- name: Upload Release Asset spring-boot-starter-elasticsearch-evolution
id: upload-release-asset-spring-boot-starter-elasticsearch-evolution
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./spring-boot-starter-elasticsearch-evolution/target/spring-boot-starter-elasticsearch-evolution-${{ env.PROJECT_VERSION }}.jar
asset_name: spring-boot-starter-elasticsearch-evolution-${{ env.PROJECT_VERSION }}.jar
asset_content_type: application/java-archive
- name: Upload Release Asset elasticsearch-evolution-core
id: upload-release-asset-elasticsearch-evolution-core
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./elasticsearch-evolution-core/target/elasticsearch-evolution-core-${{ env.PROJECT_VERSION }}.jar
asset_name: elasticsearch-evolution-core-${{ env.PROJECT_VERSION }}.jar
asset_content_type: application/java-archive