Skip to content

Conversation

@elliVM
Copy link
Contributor

@elliVM elliVM commented Oct 24, 2025

Description

Allows for publishing releases as GitHub Packages based on mvn_01 example.

  • jooq regeneration is skipped for this step
  • in the main repository a gpg sign in is required and the GitHub packages version will match the release tag
  • in a fork, gpg sign in is skipped
  • in a fork the package version will include the github actors name to differentiate it from the main repo releases, example verison in GitHub packages:
<dependency>
  <groupId>com.teragrep</groupId>
  <artifactId>pth_06</artifactId>
  <version>v1.0.5-elliVM</version>
</dependency> 

@elliVM elliVM self-assigned this Oct 24, 2025
@elliVM elliVM linked an issue Oct 24, 2025 that may be closed by this pull request
@elliVM elliVM requested a review from Tiihott October 27, 2025 07:12
Copy link
Contributor

@Tiihott Tiihott left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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

@kortemik kortemik requested review from StrongestNumber9 and removed request for StrongestNumber9 November 11, 2025 13:19
@elliVM elliVM force-pushed the release-github-packages branch from b4c673b to 4bb4f70 Compare November 17, 2025 13:02
@elliVM
Copy link
Contributor Author

elliVM commented Nov 17, 2025

rebased

name: Upload
runs-on: ubuntu-latest
permissions:
contents: read
Copy link
Contributor

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

Comment on lines 34 to 37
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
Copy link
Contributor

@StrongestNumber9 StrongestNumber9 Nov 18, 2025

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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>
Copy link
Contributor

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

Copy link
Contributor Author

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

@elliVM elliVM force-pushed the release-github-packages branch from 4bb4f70 to d245500 Compare December 8, 2025 05:36
@elliVM
Copy link
Contributor Author

elliVM commented Dec 8, 2025

rebased

@elliVM
Copy link
Contributor Author

elliVM commented Dec 8, 2025

contents: read permission removed

@elliVM
Copy link
Contributor Author

elliVM commented Dec 8, 2025

decided to remove the gpa signing completely from this workflow since packages doesn't require signed artifacts

@elliVM elliVM force-pushed the release-github-packages branch from 0a29318 to f0f7374 Compare January 23, 2026 09:14
@elliVM
Copy link
Contributor Author

elliVM commented Jan 23, 2026

rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a workflow to upload a release to github packages

3 participants