Skip to content

Commit

Permalink
reuse workflows from FAIRDataTeam/github-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisvang committed Jan 28, 2025
1 parent e8128b3 commit 435602d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 47 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
name: Maven CI

on: [ push, pull_request ]
on:
- push
- pull_request
# enable manual trigger
- workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# temurin LTS versions
version: [17, 21]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.version }}
distribution: 'temurin'
cache: maven

- name: Maven build (skip gpg signing)
run: mvn --batch-mode --update-snapshots --fail-fast -Dgpg.skip tidy:check com.mycila:license-maven-plugin:check com.github.spotbugs:spotbugs-maven-plugin:check verify
test:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v1
with:
mvn_options: 'tidy:check com.mycila:license-maven-plugin:check com.github.spotbugs:spotbugs-maven-plugin:check'
33 changes: 6 additions & 27 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,9 @@ on:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven
# https://github.com/actions/setup-java
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
# using java 17 for now, to match original
# todo: migrate to java 21 (LTS)
java-version: 17
distribution: 'temurin'
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central Portal
# visit https://central.sonatype.com/publishing/deployments in case of validation issues
run: mvn --batch-mode deploy
env:
GROUP_ID: ${{ vars.GROUP_ID }}
# https://central.sonatype.org/publish/generate-portal-token/
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
test:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v1
publish:
needs: test
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-publish.yml@v1
secrets: inherit

0 comments on commit 435602d

Please sign in to comment.