Skip to content

Commit

Permalink
tweaked workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sdh100shaun committed May 11, 2024
1 parent 747ab23 commit 9f9b668
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,16 @@ jobs:
id: release
with:
release-type: maven

call-build-maven:
needs: release-please
name: build with Maven
uses: ./.github/workflows/maven_build.yaml


publish:
if: ${{needs.release-please.outputs.release_created}}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- release-please
- call-build-maven
steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -46,8 +42,9 @@ jobs:
cache: 'maven'

- name: Publish to GitHub Packages Apache Maven
if: ${{needs.release-please.outputs.release_created}}
run: mvn --batch-mode deploy
uses: ./.github/workflows/maven.yaml
with:
maven-goal: deploy
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:

build-maven:
name: build with Maven
uses: ./.github/workflows/maven_build.yaml
uses: ./.github/workflows/maven.yaml
with:
maven-goal: 'package'
needs: security


25 changes: 25 additions & 0 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Maven

on:
workflow_call:
inputs:
maven-goal:
description: 'Maven goal to run'
required: true
default: 'package'
type: string

permissions:
contents: read


jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: mvn -B -P github ${{ inputs.maven-goal}}


19 changes: 0 additions & 19 deletions .github/workflows/maven_build.yaml

This file was deleted.

0 comments on commit 9f9b668

Please sign in to comment.