diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d3a41c..1fc04e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,43 +1,20 @@ +--- name: Build +# yamllint disable-line rule:truthy on: - pull_request: + push: branches: - - release/* + - release/* pull_request: jobs: + yamllint: + uses: dropwizard/workflows/.github/workflows/yamllint.yml@main build: - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - java_version: ['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 + java-version: ['11', '17', '21'] + uses: dropwizard/workflows/.github/workflows/maven.yml@main + secrets: inherit + with: + java-version: ${{ matrix.java-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6722e0..8e06845 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,29 +1,11 @@ +--- name: Release +# yamllint disable-line rule:truthy on: push: tags: - - dropwizard-flyway-* + - dropwizard-flyway-* 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: '11' - 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 diff --git a/.github/workflows/trigger-release.yml b/.github/workflows/trigger-release.yml new file mode 100644 index 0000000..454d437 --- /dev/null +++ b/.github/workflows/trigger-release.yml @@ -0,0 +1,22 @@ +--- +# yamllint disable rule:comments rule:line-length +name: Trigger Release +# yamllint disable-line rule:truthy +on: + workflow_dispatch: + inputs: + releaseVersion: + description: Version of the next release + required: true + type: string + developmentVersion: + description: Version of the next development cycle (must end in "-SNAPSHOT") + required: true + type: string +jobs: + release: + uses: dropwizard/workflows/.github/workflows/trigger-release.yml@main + secrets: inherit + with: + releaseVersion: ${{ inputs.releaseVersion }} + developmentVersion: ${{ inputs.developmentVersion }}