Skip to content

Commit

Permalink
fix: amend workflows for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sdh100shaun committed May 18, 2024
1 parent a4594ee commit c721aaa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
43 changes: 23 additions & 20 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v4
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: maven



publish:
if: ${{needs.release-please.outputs.release_created}}
runs-on: ubuntu-latest
Expand All @@ -31,21 +30,25 @@ jobs:
needs:
- release-please
steps:
- name: checkout code
uses: actions/checkout@v4
- name: checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
cache: 'maven'

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'corretto'
cache: 'maven'

- name: Publish to GitHub Packages Apache Maven
uses: ./.github/workflows/maven.yaml
with:
maven-goal: deploy
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}


push:
if: ${{needs.release-please.outputs.release_created}}
permissions:
contents: read
packages: write

name: Publish to GitHub Packages Apache Maven
uses: ./.github/workflows/maven.yaml
secrets: inherit
with:
maven-goal: deploy
needs: release-please
6 changes: 4 additions & 2 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: whelk-io/maven-settings-xml-action@v22
with:
servers: '[{ "id":"dvsa-github-packages", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } },{ "id":"github-publish", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]'

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


16 changes: 7 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>github-publish</id>
<name>GitHub dvsa Apache Maven Packages</name>
<url>${github.url}</url>
</repository>
</distributionManagement>
</profile>
</profiles>

Expand Down Expand Up @@ -95,13 +102,4 @@
<version>2.2</version>
</dependency>
</dependencies>


<distributionManagement>
<repository>
<id>github</id>
<name>GitHub dvsa Apache Maven Packages</name>
<url>${github.url}</url>
</repository>
</distributionManagement>
</project>

0 comments on commit c721aaa

Please sign in to comment.