Skip to content

Commit

Permalink
Merge pull request #14 from dvsa/feat-vol-5246-fix
Browse files Browse the repository at this point in the history
Feat vol 5246 fix
  • Loading branch information
sdh100shaun authored May 19, 2024
2 parents 3a91c54 + 9664a4f commit 8dfbfcd
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 34 deletions.
45 changes: 24 additions & 21 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ 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:

setup:
if: ${{needs.release-please.outputs.release_created}}
runs-on: ubuntu-latest
permissions:
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
8 changes: 5 additions & 3 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ on:

permissions:
contents: read

packages: write

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

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

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


35 changes: 25 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.dvsa.testing.lib</groupId>
<artifactId>uri-constructor</artifactId>
<artifactId>vol-uri-constructor</artifactId>
<version>2.0.3</version>

<properties>
Expand All @@ -13,6 +13,30 @@
<github.url>https://maven.pkg.github.com/dvsa/vol-uri-constructor</github.url>
</properties>


<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>github-publish</id>
<name>GitHub dvsa Apache Maven Packages</name>
<url>${github.url}</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</distributionManagement>
</profile>
</profiles>

<build>
<extensions>
<extension>
Expand Down Expand Up @@ -49,13 +73,4 @@
<version>${jetbrains-annotations-version}</version>
</dependency>
</dependencies>

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

</project>

0 comments on commit 8dfbfcd

Please sign in to comment.