Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publishing to Google artifact registry #322

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-maven-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
uses: ./.github/workflows/reusable-maven.yml
with:
path_to_package: common/org.eclipse.theia.cloud.common/
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/ci-maven-conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
uses: ./.github/workflows/reusable-maven.yml
with:
path_to_package: common/maven-conf/
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/ci-maven-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
with:
path_to_package: operator/org.eclipse.theia.cloud.operator/
dependencies: common/maven-conf/,common/org.eclipse.theia.cloud.common/
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/ci-maven-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
with:
path_to_package: service/org.eclipse.theia.cloud.service/
dependencies: common/maven-conf/,common/org.eclipse.theia.cloud.common/
secrets: inherit
20 changes: 19 additions & 1 deletion .github/workflows/reusable-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
cd -
done

- name: Publish package
- name: Publish package to GitHub Packages
if: |
(github.event_name == 'push' && steps.version_check.outputs.is_snapshot_version == 'true') ||
(github.event_name == 'release' && steps.version_check.outputs.is_snapshot_version == 'false')
Expand All @@ -98,3 +98,21 @@ jobs:
mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Authenticate to Google Cloud
if: |
(github.event_name == 'push' && steps.version_check.outputs.is_snapshot_version == 'true') ||
(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 }}'

- name: Publish package to Google Artifact Registry
if: |
(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: |
cd ${{ inputs.path_to_package }}
mvn --batch-mode deploy -Partifact-registry
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
54 changes: 47 additions & 7 deletions java/common/maven-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,52 @@
<webhooks.framework.core.version>1.1.2</webhooks.framework.core.version>
</properties>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/eclipsesource/theia-cloud</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/eclipsesource/theia-cloud</url>
</repository>
</distributionManagement>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>

<profile>
<id>artifact-registry</id>
<distributionManagement>
<snapshotRepository>
<id>artifact-registry</id>
<name>Google Artifact Registry</name>
<url>artifactregistry://europe-west3-maven.pkg.dev/kubernetes-238012/theia-cloud</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>artifact-registry</id>
<url>artifactregistry://europe-west3-maven.pkg.dev/kubernetes-238012/theia-cloud</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>