Skip to content

Setup deployment on GitHub packages - #2049

Merged
easbar merged 11 commits into
masterfrom
github_packages
May 28, 2020
Merged

easbar merged 11 commits into
masterfrom
github_packages

Conversation

@easbar

@easbar easbar commented May 28, 2020

Copy link
Copy Markdown
Member

Every commit is built and the Maven artifacts are deployed to GitHub packages (See the 'packages' icon in the 'Code' tab on GitHub) where the version is set to the git commit hash. The 'Actions' tab on GitHub shows the build jobs. The builds do not contain the ready-to-use fat jars for the GraphHopper server and are only meant to be used for development purposes.

Comment on lines +11 to +17
- name: Cache Maven artifacts
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

@easbar easbar May 28, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a hash code from the pom.xml files and uses this has caching key to cache the .m2 folder. The cached files still have to be downloaded on every build so its probably not much faster, but at least this way the logs are not as messy :)

Comment thread pom.xml
Comment on lines -267 to -270
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we need this as we are not releasing any 'snapshot' artifacts?

run: |
mvn -B versions:set -DnewVersion=$GITHUB_SHA -DgenerateBackupPoms=false
mvn -B -DskipTests -Dskip.npm -Pskip-shaded-web-jar -Pskip-tools-jar deploy
mvn -B -DskipTests -Dskip.installnodenpm -Dskip.npm -Pskip-shaded-web-jar -Pskip-tools-jar deploy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, here we can use it this.

@karussell karussell left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

btw: just for future review: the intention to do this is to release every commit into our own maven repo instead of maven central. (And this could also be done with travis but via github actions is a bit simpler). A proper release can be still done via tagging a commit (travis then pushes it to maven central), then also all tests are executed and jars are created.

@karussell karussell added this to the 2.0 milestone May 28, 2020
@easbar easbar mentioned this pull request May 28, 2020
2 tasks done
@easbar

easbar commented May 28, 2020

Copy link
Copy Markdown
Member Author

Another gotcha: While the packages can be downloaded from github even without signing up using them via maven requires authentication with any github account. So you might have to create a personal access token and modify your local ~/.m2/settings.xml file as described here: https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages#authenticating-to-github-packages

@easbar
easbar merged commit b152566 into master May 28, 2020
@easbar
easbar deleted the github_packages branch May 28, 2020 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants