Skip to content

Commit 4d95898

Browse files
committed
Use shared workflows
1 parent c201757 commit 4d95898

File tree

2 files changed

+10
-61
lines changed

2 files changed

+10
-61
lines changed

.github/workflows/build.yml

+5-38
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,10 @@
1+
---
12
name: Build
2-
on:
3+
# yamllint disable-line rule:truthy
4+
on:
35
push:
4-
branches:
5-
- 2.1.x
66
pull_request:
77
jobs:
88
build:
9-
runs-on: ${{ matrix.os }}
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
java_version: ['8', '11', '17']
14-
os: ['ubuntu-latest']
15-
env:
16-
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
17-
steps:
18-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
19-
with:
20-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
21-
- name: Set up JDK
22-
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
23-
with:
24-
distribution: 'temurin'
25-
java-version: ${{ matrix.java_version }}
26-
cache: 'maven'
27-
- name: Cache SonarCloud packages
28-
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
29-
env:
30-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31-
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
32-
with:
33-
path: ~/.sonar/cache
34-
key: ${{ runner.os }}-sonar
35-
restore-keys: ${{ runner.os }}-sonar
36-
- name: Build
37-
run: ./mvnw -B -V -ntp install
38-
- name: Analyze with SonarCloud
39-
if: ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
42-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43-
run: ./mvnw -B -V -ntp org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
9+
uses: dropwizard/workflows/.github/workflows/maven.yml@main
10+
secrets: inherit

.github/workflows/release.yml

+5-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1+
---
12
name: Release
3+
# yamllint disable-line rule:truthy
24
on:
35
push:
46
tags:
5-
- dropwizard-kafka-*
7+
- dropwizard-kafka-*
68
jobs:
79
release:
8-
runs-on: 'ubuntu-latest'
9-
env:
10-
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
11-
steps:
12-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
13-
- name: Set up JDK
14-
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
15-
with:
16-
distribution: 'temurin'
17-
java-version: '8'
18-
cache: 'maven'
19-
server-id: ossrh
20-
server-username: CI_DEPLOY_USERNAME
21-
server-password: CI_DEPLOY_PASSWORD
22-
gpg-passphrase: GPG_PASSPHRASE
23-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
24-
- name: Build and Deploy
25-
run: ./mvnw -B -V -ntp -Prelease deploy
26-
env:
27-
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
28-
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
29-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
10+
uses: dropwizard/workflows/.github/workflows/release.yml@main
11+
secrets: inherit

0 commit comments

Comments
 (0)