Skip to content

Commit

Permalink
update pom.xml and GitHub workflow to deploy to new repo (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
joker234 authored Sep 1, 2023
1 parent e823b75 commit d1493d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 43 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/push-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,29 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml', '**/package.json') }}
restore-keys: |
${{ runner.os}}-node_modules-
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "heigit-nexus-snapshots",
"username": "${{ secrets.NEXUS_USERNAME }}",
"password": "${{ secrets.NEXUS_PASSWORD }}"
}, {
"id": "heigit-nexus-releases",
"username": "${{ secrets.NEXUS_USERNAME }}",
"password": "${{ secrets.NEXUS_PASSWORD }}"
}]
- name: Build and publish package on snapshot
if: github.event_name == 'push' && github.event_name != 'release'
run: |
mvn -B -DskipTests -Pskip-shaded-web-jar -Pskip-tools-jar source:jar deploy
env:
RT_USERNAME: ${{ secrets.RT_USERNAME }}
RT_PASSWORD: ${{ secrets.RT_PASSWORD }}
NEXUS_BASE_URL: ${{ vars.NEXUS_BASE_URL }}
# Write a task to publish the package to GitHub Packages when a release is published
- name: Build and publish package on release
if: github.event_name == 'release'
run: |
mvn versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
mvn -B -DskipTests -Pskip-shaded-web-jar -Pskip-tools-jar source:jar deploy
env:
RT_USERNAME: ${{ secrets.RT_USERNAME }}
RT_PASSWORD: ${{ secrets.RT_PASSWORD }}
NEXUS_BASE_URL: ${{ vars.NEXUS_BASE_URL }}
45 changes: 6 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,52 +302,19 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<artifactory>
<includeEnvVars>true</includeEnvVars>
<envVarsExcludePatterns>*password*,*secret*,*key*,*token*,*passphrase*</envVarsExcludePatterns>
<timeoutSec>60</timeoutSec>
</artifactory>
<publisher>
<contextUrl>https://repo.heigit.org/artifactory</contextUrl>
<username>${env.RT_USERNAME}</username>
<password>${env.RT_PASSWORD}</password>
<excludePatterns>*-tests.jar</excludePatterns>
<repoKey>libs-release-local</repoKey>
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<downloadUrl>https://repo.heigit.org/artifactory/</downloadUrl>
<repository>
<id>releases</id>
<name>HeiGIT repository</name>
<uniqueVersion>false</uniqueVersion>
<url>https://repo.heigit.org/artifactory/libs-release-local</url>
<layout>default</layout>
<id>heigit-nexus-releases</id>
<name>HeiGIT Releases</name>
<url>${env.NEXUS_BASE_URL}/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>HeiGIT repository (snapshots)</name>
<uniqueVersion>true</uniqueVersion>
<url>https://repo.heigit.org/artifactory/libs-snapshot-local</url>
<layout>default</layout>
<id>heigit-nexus-snapshots</id>
<name>HeiGIT Snapshots</name>
<url>${env.NEXUS_BASE_URL}/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

Expand Down

0 comments on commit d1493d0

Please sign in to comment.