diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index a9ff7cd..3cca501 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -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 @@ -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}} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72604eb..1eac41b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml new file mode 100644 index 0000000..87f4ff6 --- /dev/null +++ b/.github/workflows/maven.yaml @@ -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}} + + \ No newline at end of file diff --git a/.github/workflows/maven_build.yaml b/.github/workflows/maven_build.yaml deleted file mode 100644 index 72d2b9f..0000000 --- a/.github/workflows/maven_build.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Maven Build - -on: - workflow_call: - -permissions: - contents: read - packages: write - -jobs: - build: - name: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - run: mvn -B -P github package - - \ No newline at end of file diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 9a4e077..84e29a6 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -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 }} \ No newline at end of file + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/pom.xml b/pom.xml index 6721280..8fee3b8 100644 --- a/pom.xml +++ b/pom.xml @@ -335,9 +335,9 @@ - github + dvsa-github-packages GitHub dvsa Apache Maven Packages - https://maven.pkg.github.com/dvsa/vol-active-support + https://maven.pkg.github.com/dvsa/* true