Skip to content

Commit

Permalink
Merge pull request #35 from dvsa/feat-vol--5327
Browse files Browse the repository at this point in the history
feat: amended workflows
  • Loading branch information
sr4850 authored May 16, 2024
2 parents a8dfd0c + 11ef4d6 commit e3c7b0a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 32 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.

4 changes: 2 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
cache: maven
- uses: whelk-io/maven-settings-xml-action@v22
with:
servers: '[{ "id":"github-vol-active-support", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]'
servers: '[{ "id":"dvsa-github-packages", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]'

- run: snyk test --severity-threshold=${{ inputs.severity-threshold || 'high' }} -- -P github
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@

<repositories>
<repository>
<id>github</id>
<id>dvsa-github-packages</id>
<name>GitHub dvsa Apache Maven Packages</name>
<url>https://maven.pkg.github.com/dvsa/vol-active-support</url>
<url>https://maven.pkg.github.com/dvsa/*</url>
<releases>
<enabled>true</enabled>
</releases>
Expand Down

0 comments on commit e3c7b0a

Please sign in to comment.