-
Notifications
You must be signed in to change notification settings - Fork 9
add workflow to upload release to GitHub packages #233
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
base: main
Are you sure you want to change the base?
Conversation
Tiihott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks consistent with the mvn_01 example and the additional logic for fork handling seems fine.
The addition of content read permission requires clarification though.
| name: Upload | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is read permission required? The read permission is not used in mvn_01 example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to give the jobs minimum permissions when using an access token, as recommended here GitHub Guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The read permission should not be necessary as mvn_01 repository version is known to work at the moment
b4c673b to
4bb4f70
Compare
|
rebased |
| name: Upload | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The read permission should not be necessary as mvn_01 repository version is known to work at the moment
| if [ "${{ github.repository_owner }}" = "teragrep" ]; then | ||
| mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -Dgithub.packages.url="https://maven.pkg.github.com/${{ github.repository_owner }}/pth_06" clean deploy -Ppublish-github-packages | ||
| else | ||
| mvn --batch-mode -Drevision=${{ github.event.release.tag_name }}-${{ github.actor }} -Dsha1= -Dchangelist= -Dgithub.packages.url="https://maven.pkg.github.com/${{ github.repository_owner }}/pth_06" -Dgpg.skip=true clean deploy -Ppublish-github-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is good compromise between security and readability. I think we have removed gpg plugin completely for some other builds which weren't published to maven central. Edit: Ah, there were github.actor as well. Then it is all good otherwise.
What is the point of the github.packages.url property though? In mvn_01 the url is set as such https://github.com/teragrep/mvn_01/blob/main/workflows/pom.xml#L168C11-L168C75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional note: The signing is not set up. Read https://github.com/teragrep/mvn_01/blob/main/workflows/upload_release_maven_central.yaml#L24-L41 for more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skipping signing completely since it's not really relevant for GitHub packages
pom.xml
Outdated
| <id>github</id> | ||
| <name>GitHub Packages</name> | ||
| <url>https://maven.pkg.github.com/teragrep/pth_06</url> | ||
| <url>${github.packages.url}</url> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use https://maven.pkg.github.com/${env.GITHUB_REPOSITORY} as the value, do not pass anything as property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed to use suggestion value
4bb4f70 to
d245500
Compare
|
rebased |
|
|
|
decided to remove the gpa signing completely from this workflow since packages doesn't require signed artifacts |
…to github packages
0a29318 to
f0f7374
Compare
|
rebased |
Description
Allows for publishing releases as GitHub Packages based on mvn_01 example.