Skip to content

jpa

jpa #212

Workflow file for this run

name: jpa
on:
create:
branches: [ 'release/**' ]
push:
branches: [ main ]
tags: [ 'jpa/v*' ]
paths:
- 'buildSrc'
- 'jpa-ext/**'
- '.github/workflows/jpa.yml'
- '.github/actions/*.yml'
pull_request:
types: [ opened, synchronize, reopened, closed ]
branches: [ main ]
paths:
- 'buildSrc'
- 'jpa-ext/**'
- '.github/workflows/jpa.yml'
- '.github/actions/*.yml'
env:
PROFILE: jpa
jobs:
context:
uses: zero88/shared-ghactions/.github/workflows/project-context.yml@main
with:
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations
profile: 'jpa'
gitTagPrefix: 'jpa/v'
versionFile: jpa-ext/gradle.properties
secrets:
githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
build:
needs: context
if: needs.context.outputs.shouldBuild == 'true'
strategy:
matrix:
java: [ '8', '11', '17' ]
os: [ 'ubuntu-latest', 'windows-latest' ]
name: Build & Test Java ${{ matrix.java }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build
uses: ./.github/actions/gha-build
with:
profile: ${{ env.PROFILE }}
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
javaVersion: ${{ matrix.java }}
- name: Test
shell: bash
run: ./gradlew test -Pprofile=${{ env.PROFILE }}
publish:
needs: [ context, build ]
if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true'
uses: zero88/shared-ghactions/.github/workflows/gradle-publish.yml@main
with:
profile: 'jpa'
version: ${{ needs.context.outputs.version }}
semanticVersion: ${{ needs.context.outputs.semanticVersion }}
hashVersion: ${{ needs.context.outputs.commitId }}
isRelease: ${{ needs.context.outputs.isRelease }}
secrets:
ossrhUser: ${{ secrets.OSS_SONATYPE_USER }}
ossrhToken: ${{ secrets.OSS_SONATYPE_PASSWORD }}
gpgKey: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}
release:
runs-on: ubuntu-latest
needs: [ context, publish ]
if: needs.context.outputs.isRelease == 'true'
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ env.PROFILE }} ${{ needs.context.outputs.version }}
tag_name: ${{ needs.context.outputs.branch }}
generate_release_notes: false