GBLD-1108: #35
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: GitHub CI | |
on: | |
push: | |
branches: | |
- develop | |
- '**' | |
# don't execute push builds for dependabot - these are done with pull requests | |
- '!dependabot/**' | |
# gh-pages is something entirely different | |
- '!gh-pages' | |
# builds from branch master should not be done. Releases are done with builds from tags | |
- '!master' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- develop | |
- '**' | |
- '!gh-pages' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macOS-latest ] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Set up JDK 8 | |
id: java8 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: '8' | |
- name: Set up JDK 11 | |
id: java11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: '11' | |
cache: 'maven' | |
- name: Setup maven toolchains.xml | |
shell: bash | |
run: | | |
echo "JAVA8_HOME=${{ steps.java8.outputs.path }}" >> $GITHUB_ENV | |
echo "JAVA11_HOME=${{ steps.java11.outputs.path }}" >> $GITHUB_ENV | |
cp tools/toolchains.xml $HOME/.m2/ | |
- name: Prepare release | |
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.repository == 'm2e-code-quality/m2e-code-quality' && startsWith(github.ref, 'refs/tags/') }} | |
shell: bash | |
run: tools/prepare_release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build with Maven | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: bash tools/build.sh | |
env: | |
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
- name: Publish update site | |
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.repository == 'm2e-code-quality/m2e-code-quality' }} | |
shell: bash | |
run: tools/publish-update-site.sh | |
env: | |
PUBLISH_SITE_TOKEN: ${{ secrets.PUBLISH_SITE_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish release | |
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.repository == 'm2e-code-quality/m2e-code-quality' && startsWith(github.ref, 'refs/tags/') }} | |
shell: bash | |
run: tools/release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |