Skip to content

Commit

Permalink
Use shared workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Dec 6, 2023
1 parent c201757 commit e92c4a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 60 deletions.
41 changes: 3 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,8 @@
name: Build
on:
on:
push:
branches:
- 2.1.x
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java_version: ['8', '11', '17']
os: ['ubuntu-latest']
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java_version }}
cache: 'maven'
- name: Cache SonarCloud packages
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build
run: ./mvnw -B -V -ntp install
- name: Analyze with SonarCloud
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B -V -ntp org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
uses: dropwizard/workflows/.github/workflows/maven.yml@main
secrets: inherit
24 changes: 2 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,5 @@ on:
- dropwizard-kafka-*

Check failure on line 5 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / build / 🧹 yamllint

wrong indentation: expected 6 but found 4
jobs:
release:
runs-on: 'ubuntu-latest'
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up JDK
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build and Deploy
run: ./mvnw -B -V -ntp -Prelease deploy
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
uses: dropwizard/workflows/.github/workflows/release.yml@main
secrets: inherit

0 comments on commit e92c4a6

Please sign in to comment.