Skip to content

Commit

Permalink
Configure ci-friendly versions for maven
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernAkAManf committed Nov 13, 2020
1 parent d680fa2 commit 901cde7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/gh-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 1.8
# generate GitHub Package Registry ci-friendly version to avoid collision
- run: echo "GPR_VERSION=$(date '+%Y%m%d.%H%M')" >> $GITHUB_ENV
- name: Maven install
run: mvn clean install
run: mvn -Dgpr.version=$GPR_VERSION clean install
working-directory: 'hello-strongbox-maven'
# This is seperate so it may only be deployed conditionally
- name: Maven deploy
run: mvn -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/$GITHUB_REPOSITORY deploy
run: mvn -Dgpr.version=$GPR_VERSION -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/$GITHUB_REPOSITORY deploy
working-directory: 'hello-strongbox-maven'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 9 additions & 1 deletion hello-strongbox-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@

<groupId>org.carlspring.strongbox.examples</groupId>
<artifactId>hello-strongbox-maven</artifactId>
<version>1.0-SNAPSHOT</version>
<version>${gpr.version}</version>

<inceptionYear>2019</inceptionYear>

<properties>
<!-- GPR-friendly artifact version when deploying to GitHub Package Registry -->
<!-- The version string is generated via a GitHub action that deploys the artifact to the GitHub Package Registry -->
<!-- This is necessary as GitHub does not support overriding of published artifacts -->
<!-- See https://docs.github.com/en/free-pro-team@latest/packages/publishing-and-managing-packages/deleting-a-package#about-public-package-deletion -->
<gpr.version>1.0-SNAPSHOT</gpr.version>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
Expand Down

0 comments on commit 901cde7

Please sign in to comment.