Skip to content

Commit

Permalink
Fix maven publishing for release versions
Browse files Browse the repository at this point in the history
Add the repository field to the pom.xml.
Also try to fix that the build dependencies step is not executed on release version pushes.
  • Loading branch information
sgraband committed Jul 23, 2024
1 parent 3d1bdf5 commit 3563ca9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/reusable-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- id: version_check
- name: Run Version Check
id: version_check
run: |
cd ${{ inputs.path_to_package }}
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
Expand All @@ -77,9 +78,11 @@ jobs:

- name: Build dependencies
if: |
${{ inputs.dependencies != '' }} &&
(github.event_name == 'push' && steps.version_check.outputs.is_snapshot_version == 'true') ||
(github.event_name == 'release' && steps.version_check.outputs.is_snapshot_version == 'false')
${{ inputs.dependencies != '' }} &&
(
(github.event_name == 'push' && steps.version_check.outputs.is_snapshot_version == 'true') ||
(github.event_name == 'release' && steps.version_check.outputs.is_snapshot_version == 'false')
)
run: |
IFS=',' read -r -a dirs <<< "${{ inputs.dependencies }}"
for dir in "${dirs[@]}"
Expand All @@ -105,7 +108,7 @@ jobs:
(github.event_name == 'release' && steps.version_check.outputs.is_snapshot_version == 'false')
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
credentials_json: "${{ secrets.GCP_SA_KEY }}"

- name: Publish package to Google Artifact Registry
if: |
Expand Down
5 changes: 5 additions & 0 deletions java/common/maven-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
<profile>
<id>artifact-registry</id>
<distributionManagement>
<repository>
<id>artifact-registry</id>
<name>Google Artifact Registry</name>
<url>artifactregistry://europe-west3-maven.pkg.dev/kubernetes-238012/theia-cloud</url>
</repository>
<snapshotRepository>
<id>artifact-registry</id>
<name>Google Artifact Registry</name>
Expand Down

0 comments on commit 3563ca9

Please sign in to comment.